@@ -2,23 +2,25 @@ name: Release
2
2
3
3
on :
4
4
release :
5
- types : [published]
5
+ types : [published] # once a release is published in the GitHub UI
6
+ workflow_dispatch : # or manually, by clicking the button
6
7
7
8
jobs :
8
9
build :
9
10
runs-on : ubuntu-latest
10
11
11
12
steps :
12
- - uses : actions/checkout@v4
13
+ - name : 1. Checkout sources
14
+ uses : actions/checkout@v4
13
15
14
- - name : get version from tag
16
+ - name : 2. Extract version from tag
15
17
id : get_version
16
18
run : |
17
19
realversion="${GITHUB_REF/refs\/tags\//}"
18
20
realversion="${realversion//v/}"
19
21
echo "VERSION=$realversion" >> $GITHUB_OUTPUT
20
22
21
- - name : Set up publishing to maven central
23
+ - name : 3. Set up Java with Maven cache
22
24
uses : actions/setup-java@v4
23
25
with :
24
26
java-version : ' 8'
@@ -28,20 +30,20 @@ jobs:
28
30
server-username : MAVEN_USERNAME
29
31
server-password : MAVEN_PASSWORD
30
32
31
- - name : mvn versions
33
+ - name : 4. Update version in Maven configuration
32
34
run : mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
33
35
34
- - name : Install gpg key
36
+ - name : 5. Install GPG key
35
37
run : |
36
38
cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import
37
39
gpg --list-secret-keys --keyid-format LONG
38
40
39
- - name : Publish
41
+ - name : 6. Publish to Maven
40
42
run : |
41
43
mvn --no-transfer-progress \
42
44
--batch-mode \
43
45
-Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \
44
- deploy -P release
46
+ release:perform
45
47
env :
46
48
MAVEN_USERNAME : ${{secrets.OSSH_USERNAME}}
47
- MAVEN_PASSWORD : ${{secrets.OSSH_TOKEN}}
49
+ MAVEN_PASSWORD : ${{secrets.OSSH_TOKEN}}
0 commit comments