Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .github/workflows/early-access.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: CI - Early Access

on:
schedule:
# Runs at 00:00 UTC every day
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
contents: write

env:
JAVA_VERSION: '21'
JAVA_DISTRO: 'temurin'

jobs:
precheck:
if: github.repository == 'snowdrop/acp-client' && startsWith(github.event.head_commit.message, 'Releasing version') != true
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.vars.outputs.VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Cancel previous run
uses: styfle/cancel-workflow-action@0.13.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Java
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
cache: maven

- name: Version
id: vars
shell: bash
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$(echo $VERSION)" >> $GITHUB_OUTPUT

release:
needs: [ precheck ]
if: endsWith(${{ needs.precheck.outputs.VERSION }}, '-SNAPSHOT')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
cache: maven
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Configure git user and email
run: |
git config --global user.email "action@github.com"
git config --global user.name "Github Action"

- name: Build the uber-jar of the acp-java-client
run: |
mvn -ntp -B clean install -DskipTests -Dquarkus.package.jar.type=uber-jar

- name: Update jBang catalog for snapshot
if: github.ref == 'refs/heads/main'
run: |
VERSION=${{ needs.precheck.outputs.VERSION }}
ARTIFACT_ID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout -pl client)
GROUP_ID=$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout -pl client)
SNAPSHOT_GAV="${GROUP_ID}:${ARTIFACT_ID}:${VERSION}:runner"
jq --arg gav "$SNAPSHOT_GAV" '.aliases.acp."script-ref" = $gav' jbang-catalog.json > tmp.json && mv tmp.json jbang-catalog.json

- name: Commit the changes
run: |
VERSION=${{ needs.precheck.outputs.VERSION }}
git add .
if git diff --cached --quiet; then
echo "No changes detected in jbang-catalog.json. Skipping commit."
else
echo "Changes detected. Committing version ${VERSION}..."
git commit -m "update jbang catalog script-ref: ${VERSION}"
git push origin main
fi

- name: Create early-access release with uber-jar
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=${{ needs.precheck.outputs.VERSION }}
UBER_JAR=$(find client/target -name "*-runner.jar" -type f | head -1)

# Delete existing early-access release if present
gh release delete early-access --yes --cleanup-tag 2>/dev/null || true

# Create new early-access release
gh release create early-access \
--title "Early Access - ${VERSION}" \
--notes "Early access build of version ${VERSION}" \
--prerelease \
"${UBER_JAR}"

- name: Deploy the maven GAV on central
run: |
mvn -B deploy -Prelease -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
24 changes: 24 additions & 0 deletions .github/workflows/mvn-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "CI - JDK 21 Build"

on:
push:
branches: [ main ]
paths-ignore:
- '.github/project.yml'
pull_request:
branches: [ main ]


jobs:
build-jdk21:
name: "JDK 21 Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Build and test
run: mvn clean install -ntp -B
4 changes: 2 additions & 2 deletions jbang-catalog.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"aliases": {
"acp": {
"script-ref": "client/target/acp-java-client-0.1.0-SNAPSHOT-runner.jar",
"description": "ACP Java Client for any ACP-compatible agent"
"description": "ACP Java Client for any ACP-compatible agent",
"script-ref": "io.quarkiverse.ai:acp-java-client:0.1.0-SNAPSHOT:runner"
}
}
}
90 changes: 90 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@

<exec-maven-plugin.version>3.6.3</exec-maven-plugin.version>
<quarkus.platform.version>3.35.3</quarkus.platform.version>

<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -105,4 +110,89 @@
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<doclint>none</doclint>
<quiet>true</quiet>
<additionalOptions>
<additionalOption>-Xdoclint:none</additionalOption>
</additionalOptions>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<doclint>none</doclint>
<quiet>true</quiet>
<additionalOptions>
<additionalOption>-Xdoclint:none</additionalOption>
</additionalOptions>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>