From 249a01b9709b6b0be99eabc76508d658e26220c1 Mon Sep 17 00:00:00 2001 From: Aayush Atharva Date: Fri, 3 Apr 2026 20:16:14 +0000 Subject: [PATCH 1/3] Enable Snapshots --- .github/workflows/release.yml | 4 +- .github/workflows/snapshot.yml | 53 ++++++++++++++++++++++ client/pom.xml | 2 +- pom.xml | 82 ++++++++++++++++++---------------- 4 files changed, 100 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/snapshot.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 193605252..c3c0697da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,10 +43,10 @@ jobs: passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Build - run: mvn -ntp -B clean verify install -DskipTests + run: mvn -ntp -B clean verify install -DskipTests -Prelease - name: Publish to Maven Central env: GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: mvn -ntp -B deploy -DskipTests -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE} + run: mvn -ntp -B deploy -DskipTests -Prelease -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 000000000..26c5f9aa5 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,53 @@ +name: Snapshot Deploy + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + deploy-snapshot: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-java@v5 + with: + distribution: 'corretto' + java-version: '11' + + - name: Grant Permission + run: chmod +x ./mvnw + + - name: Check SNAPSHOT version + id: check-version + run: | + VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + if [[ "$VERSION" == *-SNAPSHOT ]]; then + echo "is_snapshot=true" >> "$GITHUB_OUTPUT" + else + echo "is_snapshot=false" >> "$GITHUB_OUTPUT" + fi + + - name: Remove old Maven Settings + if: steps.check-version.outputs.is_snapshot == 'true' + run: rm -f /home/runner/.m2/settings.xml + + - name: Maven Settings + if: steps.check-version.outputs.is_snapshot == 'true' + uses: s4u/maven-settings-action@v4.0.0 + with: + servers: | + [{ + "id": "central", + "username": "${{ secrets.OSSRH_USERNAME }}", + "password": "${{ secrets.OSSRH_PASSWORD }}" + }] + + - name: Deploy Snapshot + if: steps.check-version.outputs.is_snapshot == 'true' + run: ./mvnw -B -ntp deploy -DskipTests diff --git a/client/pom.xml b/client/pom.xml index 181dcd2e6..cf6f85a4b 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -19,7 +19,7 @@ org.asynchttpclient async-http-client-project - 3.0.8 + 3.0.9-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 919b27a7c..4a88b551d 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ org.asynchttpclient async-http-client-project - 3.0.8 + 3.0.9-SNAPSHOT pom AHC/Project @@ -77,12 +77,12 @@ - sonatype-nexus-staging - https://oss.sonatype.org/content/repositories/snapshots + central + https://central.sonatype.com/repository/maven-snapshots/ - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + central + https://central.sonatype.com @@ -399,39 +399,6 @@ - - org.sonatype.central - central-publishing-maven-plugin - 0.10.0 - true - - central - - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.8 - - - sign-artifacts - verify - - sign - - - - - --pinentry-mode - loopback - - false - - - - - org.revapi revapi-maven-plugin @@ -522,5 +489,44 @@ + + + + release + + + + org.sonatype.central + central-publishing-maven-plugin + 0.10.0 + true + + central + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + false + + + + + + + From 074c6b6ae2e4665aa150c9d1b18ec739301dbaee Mon Sep 17 00:00:00 2001 From: Aayush Atharva Date: Fri, 3 Apr 2026 20:27:20 +0000 Subject: [PATCH 2/3] Keep single workflow for release --- .github/workflows/release.yml | 60 ++++++++++++++++++++++++++++++---- .github/workflows/snapshot.yml | 53 ------------------------------ 2 files changed, 54 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/snapshot.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3c0697da..be9024366 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,64 @@ name: Release on: + push: + branches: + - main + workflow_dispatch: inputs: - name: - description: 'Github Actions - Release' - required: true - default: 'Github Actions - Release' + snapshot: + description: 'Deploy SNAPSHOT' + type: boolean + default: false + +permissions: + contents: read jobs: - Publish: + deploy-snapshot: + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.snapshot == true) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-java@v5 + with: + distribution: 'corretto' + java-version: '11' + + - name: Grant Permission + run: chmod +x ./mvnw + + - name: Check SNAPSHOT version + id: check-version + run: | + VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + if [[ "$VERSION" != *-SNAPSHOT ]]; then + echo "::error::Version $VERSION is not a SNAPSHOT version" + exit 1 + fi + + - name: Remove old Maven Settings + run: rm -f /home/runner/.m2/settings.xml + + - name: Maven Settings + uses: s4u/maven-settings-action@v4.0.0 + with: + servers: | + [{ + "id": "central", + "username": "${{ secrets.OSSRH_USERNAME }}", + "password": "${{ secrets.OSSRH_PASSWORD }}" + }] + + - name: Deploy Snapshot + run: ./mvnw -B -ntp deploy -DskipTests + + publish-release: + if: github.event_name == 'workflow_dispatch' && inputs.snapshot == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -41,7 +89,7 @@ jobs: with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - + - name: Build run: mvn -ntp -B clean verify install -DskipTests -Prelease diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml deleted file mode 100644 index 26c5f9aa5..000000000 --- a/.github/workflows/snapshot.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Snapshot Deploy - -on: - push: - branches: - - main - -permissions: - contents: read - -jobs: - deploy-snapshot: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-java@v5 - with: - distribution: 'corretto' - java-version: '11' - - - name: Grant Permission - run: chmod +x ./mvnw - - - name: Check SNAPSHOT version - id: check-version - run: | - VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - if [[ "$VERSION" == *-SNAPSHOT ]]; then - echo "is_snapshot=true" >> "$GITHUB_OUTPUT" - else - echo "is_snapshot=false" >> "$GITHUB_OUTPUT" - fi - - - name: Remove old Maven Settings - if: steps.check-version.outputs.is_snapshot == 'true' - run: rm -f /home/runner/.m2/settings.xml - - - name: Maven Settings - if: steps.check-version.outputs.is_snapshot == 'true' - uses: s4u/maven-settings-action@v4.0.0 - with: - servers: | - [{ - "id": "central", - "username": "${{ secrets.OSSRH_USERNAME }}", - "password": "${{ secrets.OSSRH_PASSWORD }}" - }] - - - name: Deploy Snapshot - if: steps.check-version.outputs.is_snapshot == 'true' - run: ./mvnw -B -ntp deploy -DskipTests From 240b5fca64ab5c63c2df9723b8c8077577176043 Mon Sep 17 00:00:00 2001 From: Aayush Atharva Date: Fri, 3 Apr 2026 20:50:06 +0000 Subject: [PATCH 3/3] Simplify workflow --- .github/workflows/release.yml | 46 +++------------------- pom.xml | 72 ++++++++++++++++------------------- 2 files changed, 39 insertions(+), 79 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be9024366..4a53a2b0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,8 +17,8 @@ permissions: jobs: - deploy-snapshot: - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.snapshot == true) + deploy: + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -31,11 +31,10 @@ jobs: - name: Grant Permission run: chmod +x ./mvnw - - name: Check SNAPSHOT version - id: check-version + - name: Validate SNAPSHOT version + if: github.event_name == 'push' || inputs.snapshot == true run: | VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) - echo "version=$VERSION" >> "$GITHUB_OUTPUT" if [[ "$VERSION" != *-SNAPSHOT ]]; then echo "::error::Version $VERSION is not a SNAPSHOT version" exit 1 @@ -54,47 +53,14 @@ jobs: "password": "${{ secrets.OSSRH_PASSWORD }}" }] - - name: Deploy Snapshot - run: ./mvnw -B -ntp deploy -DskipTests - - publish-release: - if: github.event_name == 'workflow_dispatch' && inputs.snapshot == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Grant Permission - run: sudo chmod +x ./mvnw - - - uses: actions/setup-java@v5 - with: - distribution: 'corretto' - java-version: '11' - - - name: Remove old Maven Settings - run: rm -f /home/runner/.m2/settings.xml - - - name: Maven Settings - uses: s4u/maven-settings-action@v4.0.0 - with: - servers: | - [{ - "id": "central", - "username": "${{ secrets.OSSRH_USERNAME }}", - "password": "${{ secrets.OSSRH_PASSWORD }}" - }] - - name: Import GPG uses: crazy-max/ghaction-import-gpg@v7.0.0 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - - name: Build - run: mvn -ntp -B clean verify install -DskipTests -Prelease - - - name: Publish to Maven Central + - name: Deploy env: GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: mvn -ntp -B deploy -DskipTests -Prelease -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE} + run: ./mvnw -B -ntp deploy -DskipTests -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE} diff --git a/pom.xml b/pom.xml index 4a88b551d..edce54ca1 100644 --- a/pom.xml +++ b/pom.xml @@ -399,6 +399,39 @@ + + org.sonatype.central + central-publishing-maven-plugin + 0.10.0 + true + + central + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + sign-artifacts + verify + + sign + + + + + --pinentry-mode + loopback + + false + + + + + org.revapi revapi-maven-plugin @@ -489,44 +522,5 @@ - - - - release - - - - org.sonatype.central - central-publishing-maven-plugin - 0.10.0 - true - - central - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.8 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - false - - - - - - -