1
1
name : release
2
2
3
3
on :
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 : { }
18
5
19
6
jobs :
20
7
build_and_deploy :
@@ -31,18 +18,10 @@ jobs:
31
18
32
19
- name : Get the version
33
20
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
40
22
41
23
- 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
46
25
47
26
- name : Upload JARs as artifact
48
27
uses : actions/upload-artifact@v2
@@ -58,17 +37,17 @@ jobs:
58
37
- uses : ./.github/actions/setup-jdk
59
38
60
39
- 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
62
41
63
42
- 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
65
44
66
45
- name : Commit release POM and Tag
67
46
run : |
68
47
git config --local user.email "action@github.com"
69
48
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 }}
72
51
73
52
- name : Set next development version
74
53
run : ./mvnw versions:set -DnextSnapshot=true -DgenerateBackupPoms=false
0 commit comments