diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 193605252..4a53a2b0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,28 +1,45 @@ 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: + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' 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: Grant Permission + run: chmod +x ./mvnw + + - name: Validate SNAPSHOT version + if: github.event_name == 'push' || inputs.snapshot == true + run: | + VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + 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 @@ -41,12 +58,9 @@ jobs: with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - - - name: Build - run: mvn -ntp -B clean verify install -DskipTests - - 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 -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/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..edce54ca1 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