Skip to content

Commit 39e1e8f

Browse files
author
diebel+1-at-601609176474
committed
Verify Java SDK publish tag version
1 parent 443ff7e commit 39e1e8f

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ jobs:
2323
java-version: "17"
2424
cache: gradle
2525

26+
- name: Verify tag version
27+
run: |
28+
tag_version="${GITHUB_REF_NAME#v}"
29+
package_version="$(awk -F\"'\" '/^version = / { print $2; exit }' build.gradle)"
30+
if [ "$package_version" != "$tag_version" ]; then
31+
echo "Tag $GITHUB_REF_NAME does not match package version $package_version"
32+
exit 1
33+
fi
34+
2635
- name: Stage Maven artifacts
2736
run: ./gradlew publishMavenPublicationToStagingRepository --no-daemon
2837

PUBLISHING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Configure Maven Central namespace ownership for `ai.vectorizer`, then add these
1212
- `JRELEASER_GPG_SECRET_KEY`
1313
- `JRELEASER_GPG_PASSPHRASE`
1414

15-
After that, push a SemVer tag such as `v1.0.0`. The workflow stages, signs, and deploys Maven artifacts, then creates a GitHub release.
15+
After that, update the generated package version, commit it, and push a matching SemVer tag such as `v1.0.0`. The workflow verifies that the tag matches `build.gradle`, stages, signs, and deploys Maven artifacts, then creates a GitHub release.

0 commit comments

Comments
 (0)