Skip to content

Commit 50e16f9

Browse files
authored
Merge pull request #7 from RobinPcrd/fix-publish-java-version
fix(ci): auto version based on tag
2 parents 6b23d2a + 4bc78e4 commit 50e16f9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ jobs:
3030
gpg-passphrase: SIGNING_PASSWORD
3131

3232
- name: Set version (if provided)
33-
if: github.event.inputs.version != ''
3433
run: |
35-
mvn versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
34+
if [ "${{ github.event_name }}" = "release" ]; then
35+
VERSION="${{ github.event.release.tag_name }}"
36+
elif [ -n "${{ github.event.inputs.version }}" ]; then
37+
VERSION="${{ github.event.inputs.version }}"
38+
else
39+
exit 0
40+
fi
41+
VERSION="${VERSION#v}"
42+
mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
3643
3744
- name: Build and publish
3845
env:

0 commit comments

Comments
 (0)