@@ -17,8 +17,8 @@ permissions:
1717
1818jobs :
1919
20- deploy-snapshot :
21- if : github.event_name == 'push' || ( github.event_name == 'workflow_dispatch' && inputs.snapshot == true)
20+ deploy :
21+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
2222 runs-on : ubuntu-latest
2323 steps :
2424 - uses : actions/checkout@v6
@@ -31,11 +31,10 @@ jobs:
3131 - name : Grant Permission
3232 run : chmod +x ./mvnw
3333
34- - name : Check SNAPSHOT version
35- id : check-version
34+ - name : Validate SNAPSHOT version
35+ if : github.event_name == 'push' || inputs.snapshot == true
3636 run : |
3737 VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
38- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3938 if [[ "$VERSION" != *-SNAPSHOT ]]; then
4039 echo "::error::Version $VERSION is not a SNAPSHOT version"
4140 exit 1
@@ -54,47 +53,14 @@ jobs:
5453 "password": "${{ secrets.OSSRH_PASSWORD }}"
5554 }]
5655
57- - name : Deploy Snapshot
58- run : ./mvnw -B -ntp deploy -DskipTests
59-
60- publish-release :
61- if : github.event_name == 'workflow_dispatch' && inputs.snapshot == false
62- runs-on : ubuntu-latest
63- steps :
64- - uses : actions/checkout@v6
65-
66- - name : Grant Permission
67- run : sudo chmod +x ./mvnw
68-
69- - uses : actions/setup-java@v5
70- with :
71- distribution : ' corretto'
72- java-version : ' 11'
73-
74- - name : Remove old Maven Settings
75- run : rm -f /home/runner/.m2/settings.xml
76-
77- - name : Maven Settings
78- uses : s4u/maven-settings-action@v4.0.0
79- with :
80- servers : |
81- [{
82- "id": "central",
83- "username": "${{ secrets.OSSRH_USERNAME }}",
84- "password": "${{ secrets.OSSRH_PASSWORD }}"
85- }]
86-
8756 - name : Import GPG
8857 uses : crazy-max/ghaction-import-gpg@v7.0.0
8958 with :
9059 gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
9160 passphrase : ${{ secrets.GPG_PASSPHRASE }}
9261
93- - name : Build
94- run : mvn -ntp -B clean verify install -DskipTests -Prelease
95-
96- - name : Publish to Maven Central
62+ - name : Deploy
9763 env :
9864 GPG_KEY_NAME : ${{ secrets.GPG_KEY_NAME }}
9965 GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
100- run : mvn -ntp -B deploy -DskipTests -Prelease -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}
0 commit comments