Skip to content

Commit fc84af0

Browse files
Add a versioning check for CI
This check ensures that the tag pushed and the Gradle version are the same, and if the two don't match, then CI will fail.
1 parent bff31c8 commit fc84af0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ jobs:
4848
echo "version=$(cat version/version.txt)" >> $GITHUB_OUTPUT
4949
echo "expectedTagName=v$(cat version/version.txt)" >> $GITHUB_OUTPUT
5050
51+
# Check if the publish.gradle version matches the tag name
52+
- name: Check version
53+
run: |
54+
if [[ "${{ steps.get-version.outputs.expectedTagName }}" != "${{ env.TAG_NAME }}" ]]; then
55+
echo "Version mismatch: ${{ steps.get-version.outputs.expectedTagName }} != ${{ env.TAG_NAME }}"
56+
exit 1
57+
fi
58+
5159
# Creates a release draft with the artifacts from the build workflow
5260
prepare-release:
5361
name: Prepare release
@@ -74,5 +82,7 @@ jobs:
7482
with:
7583
draft: true
7684
generate_release_notes: true
85+
tag_name: v${{ steps.get-version.outputs.version }}
86+
name: Version ${{ steps.get-version.outputs.version }}
7787
files: |
7888
**/**

0 commit comments

Comments
 (0)