Skip to content

Commit 6df6d5d

Browse files
committed
Set JAR version from git tag in CI
Fixes JAR being named with SNAPSHOT version on releases.
1 parent 2396848 commit 6df6d5d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ jobs:
122122
echo "Native libraries organized:"
123123
find java/src/main/resources/native -type f
124124
125+
- name: Set version from tag
126+
if: startsWith(github.ref, 'refs/tags/v')
127+
working-directory: java
128+
run: |
129+
VERSION=${GITHUB_REF#refs/tags/v}
130+
echo "Setting version to $VERSION"
131+
mvn -B versions:set -DnewVersion="$VERSION"
132+
125133
- name: Build fat JAR (skip native build, skip tests)
126134
working-directory: java
127135
run: mvn -B package -DskipTests -Dexec.skip=true

0 commit comments

Comments
 (0)