11name : release
22
33on :
4- workflow_dispatch :
5- inputs :
6- GPG_PRIVATE_KEY :
7- description : ' The private key to sign the artifacts'
8- required : true
9- type : string
10- OSSRH_USERNAME :
11- description : ' The username to deploy to Maven Central'
12- required : true
13- type : string
14- OSSRH_TOKEN :
15- description : ' The token to deploy to Maven Central'
16- required : true
17- type : string
4+ workflow_dispatch : { }
185
196jobs :
207 build_and_deploy :
@@ -31,18 +18,10 @@ jobs:
3118
3219 - name : Get the version
3320 id : get_version
34- run : echo ::set-output name=version::$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
35-
36- - name : Import GPG key
37- run : echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import
38- env :
39- GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
21+ run : echo "VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
4022
4123 - name : Deploy
42- run : ./mvnw -P release --batch-mode -DskipTests deploy
43- env :
44- MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
45- MAVEN_PASSWORD : ${{ secrets.OSSRH_TOKEN }}
24+ run : ./mvnw -P release --batch-mode -DskipTests package
4625
4726 - name : Upload JARs as artifact
4827 uses : actions/upload-artifact@v2
@@ -58,17 +37,17 @@ jobs:
5837 - uses : ./.github/actions/setup-jdk
5938
6039 - name : Set version
61- run : ./mvnw versions:set -DnewVersion=${{ steps.get_version.outputs.version }} -DgenerateBackupPoms=false
40+ run : ./mvnw versions:set -DnewVersion=${{ env.VERSION }} -DgenerateBackupPoms=false
6241
6342 - name : Update README.md
64- run : sed -i "s|<version>.*</version>|<version>${{ steps.get_version.outputs.version }}</version>|g" README.md
43+ run : sed -i "s|<version>.*</version>|<version>${{ env.VERSION }}</version>|g" README.md
6544
6645 - name : Commit release POM and Tag
6746 run : |
6847 git config --local user.email "[email protected] " 6948 git config --local user.name "GitHub Action"
70- git commit -m "Release ${{ steps.get_version.outputs.version }}" -a
71- git tag ${{ steps.get_version.outputs.version }}
49+ git commit -m "Release ${{ env.VERSION }}" -a
50+ git tag ${{ env.VERSION }}
7251
7352 - name : Set next development version
7453 run : ./mvnw versions:set -DnextSnapshot=true -DgenerateBackupPoms=false
0 commit comments