Skip to content

Commit cf586af

Browse files
author
Raffael Herrmann
committed
fix: correct semantic versioning in CI pipeline
- Fix version tag selection to prefer releases over pre-releases - Releases (v1.0.0) now take precedence over RCs (v1.0.0-rc.X) - Ensures proper semantic versioning hierarchy in CI/CD pipeline
1 parent 32700e1 commit cf586af

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/docker-build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,18 @@ jobs:
2525
id: get-tag
2626
run: |
2727
git fetch --tags
28-
LATEST_TAG=$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?$' | sort -V | tail -1)
28+
29+
# First try to find the latest release (non-RC) version
30+
RELEASE_TAG=$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | sort -V | tail -1)
31+
32+
if [ -n "$RELEASE_TAG" ]; then
33+
# Use the latest release if it exists
34+
LATEST_TAG="$RELEASE_TAG"
35+
else
36+
# Fall back to the latest RC version
37+
LATEST_TAG=$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+-rc\.[0-9]\+$' | sort -V | tail -1)
38+
fi
39+
2940
if [ -z "$LATEST_TAG" ]; then
3041
echo "No version tags found"
3142
exit 1

0 commit comments

Comments
 (0)