File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff 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)
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
You can’t perform that action at this time.
0 commit comments