Skip to content

Commit 6c1213d

Browse files
Fix tag selection
1 parent ef374ca commit 6c1213d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ jobs:
4646
- name: Calculate next version
4747
id: version
4848
run: |
49-
# Get the latest tag, handling both v-prefixed and non-prefixed tags
50-
LATEST_TAG=$(git tag --sort=-version:refname | head -1)
49+
# Get the latest tag (no longer using v prefix, filter out legacy v-prefixed tags)
50+
LATEST_TAG=$(git tag | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
5151
echo "Latest tag found: $LATEST_TAG"
5252
53-
# Extract version numbers (remove 'v' prefix if present)
53+
# Extract version numbers (remove 'v' prefix if present for backwards compatibility)
5454
VERSION_WITHOUT_V=${LATEST_TAG#v}
5555
5656
# Parse major and minor (ignore patch since we don't support it)
@@ -66,12 +66,8 @@ jobs:
6666
NEXT_MINOR=$((MINOR + 1))
6767
fi
6868
69-
# Create new version (maintain v prefix if original had one)
70-
if [[ $LATEST_TAG == v* ]]; then
71-
NEXT_VERSION="v${NEXT_MAJOR}.${NEXT_MINOR}.0"
72-
else
73-
NEXT_VERSION="${NEXT_MAJOR}.${NEXT_MINOR}.0"
74-
fi
69+
# Create new version (always without v prefix)
70+
NEXT_VERSION="${NEXT_MAJOR}.${NEXT_MINOR}.0"
7571
7672
echo "Next version: $NEXT_VERSION"
7773
echo "RELEASE_VERSION=$NEXT_VERSION" >> $GITHUB_ENV

0 commit comments

Comments
 (0)