Skip to content

Commit 29af3e9

Browse files
committed
fix version to conform to V.V.V.V (#253)
1 parent 1fff5b1 commit 29af3e9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/build-test-installer-release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,23 @@ jobs:
3535
id: compute_version
3636
shell: bash
3737
run: |
38-
# If this is a tag push and it starts with v, just use it
38+
# If this is a tag push and it starts with v, just use it and strip off the v
3939
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
4040
Version="${GITHUB_REF#refs/tags/}"
41+
Version="${Version#v}"
4142
echo "version=$Version" >> $GITHUB_OUTPUT
4243
echo "detected tag push: $Version"
4344
exit 0
4445
fi
4546
46-
# Otherwise find the latest tag that starts with v
47-
LAST_TAG=$(git describe --tags --match "v*" --abbrev=0 2>/dev/null || echo "v0.0.0")
47+
# Otherwise find the latest tag that starts with v and strip off the v
48+
LAST_TAG=$(git describe --tags --match "v*" --abbrev=0 2>/dev/null || echo "v0.0.0")
49+
LAST_TAG="${LAST_TAG#v}"
4850
4951
# Compute a build number based on number of commits since that tag
5052
COMMITS_SINCE_TAG=$(git rev-list ${LAST_TAG}..HEAD --count)
5153
52-
# Final version: vX.Y.Z+<build>
54+
# Final version: X.Y.Z
5355
Version="${LAST_TAG}.${COMMITS_SINCE_TAG}"
5456
echo "version=$Version" >> $GITHUB_OUTPUT
5557
echo "no tag push; using $Version"

0 commit comments

Comments
 (0)