File tree Expand file tree Collapse file tree 3 files changed +33
-19
lines changed
Expand file tree Collapse file tree 3 files changed +33
-19
lines changed Original file line number Diff line number Diff line change 11name : Release
22
33on :
4+ push :
5+ branches :
6+ - main
7+
48 workflow_dispatch :
59 inputs :
6- name :
7- description : ' Github Actions - Release'
8- required : true
9- default : ' Github Actions - Release'
10+ snapshot :
11+ description : ' Deploy SNAPSHOT'
12+ type : boolean
13+ default : false
14+
15+ permissions :
16+ contents : read
1017
1118jobs :
1219
13- Publish :
20+ deploy :
21+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
1422 runs-on : ubuntu-latest
1523 steps :
1624 - uses : actions/checkout@v6
1725
18- - name : Grant Permission
19- run : sudo chmod +x ./mvnw
20-
2126 - uses : actions/setup-java@v5
2227 with :
2328 distribution : ' corretto'
2429 java-version : ' 11'
2530
31+ - name : Grant Permission
32+ run : chmod +x ./mvnw
33+
34+ - name : Validate SNAPSHOT version
35+ if : github.event_name == 'push' || inputs.snapshot == true
36+ run : |
37+ VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
38+ if [[ "$VERSION" != *-SNAPSHOT ]]; then
39+ echo "::error::Version $VERSION is not a SNAPSHOT version"
40+ exit 1
41+ fi
42+
2643 - name : Remove old Maven Settings
2744 run : rm -f /home/runner/.m2/settings.xml
2845
4158 with :
4259 gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
4360 passphrase : ${{ secrets.GPG_PASSPHRASE }}
44-
45- - name : Build
46- run : mvn -ntp -B clean verify install -DskipTests
4761
48- - name : Publish to Maven Central
62+ - name : Deploy
4963 env :
5064 GPG_KEY_NAME : ${{ secrets.GPG_KEY_NAME }}
5165 GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
52- run : mvn -ntp -B deploy -DskipTests -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE}
66+ run : ./mvnw -B -ntp deploy -DskipTests -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE}
Original file line number Diff line number Diff line change 1919 <parent >
2020 <groupId >org.asynchttpclient</groupId >
2121 <artifactId >async-http-client-project</artifactId >
22- <version >3.0.8 </version >
22+ <version >3.0.9-SNAPSHOT </version >
2323 </parent >
2424
2525 <modelVersion >4.0.0</modelVersion >
Original file line number Diff line number Diff line change 2020
2121 <groupId >org.asynchttpclient</groupId >
2222 <artifactId >async-http-client-project</artifactId >
23- <version >3.0.8 </version >
23+ <version >3.0.9-SNAPSHOT </version >
2424 <packaging >pom</packaging >
2525
2626 <name >AHC/Project</name >
7777
7878 <distributionManagement >
7979 <snapshotRepository >
80- <id >sonatype-nexus-staging </id >
81- <url >https://oss .sonatype.org/content/repositories/ snapshots</url >
80+ <id >central </id >
81+ <url >https://central .sonatype.com/repository/maven- snapshots/ </url >
8282 </snapshotRepository >
8383 <repository >
84- <id >sonatype-nexus-staging </id >
85- <url >https://oss .sonatype.org/service/local/staging/deploy/maven2/ </url >
84+ <id >central </id >
85+ <url >https://central .sonatype.com </url >
8686 </repository >
8787 </distributionManagement >
8888
You can’t perform that action at this time.
0 commit comments