Skip to content
Merged
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
40 changes: 27 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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}
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<version>3.0.8</version>
<version>3.0.9-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<version>3.0.8</version>
<version>3.0.9-SNAPSHOT</version>
<packaging>pom</packaging>

<name>AHC/Project</name>
Expand Down Expand Up @@ -77,12 +77,12 @@

<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>central</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>central</id>
<url>https://central.sonatype.com</url>
</repository>
</distributionManagement>

Expand Down
Loading