Update release.yml

This commit is contained in:
2025-10-24 16:05:36 +08:00
committed by GitHub
parent 9f049cf2ca
commit ee8b9d6619

View File

@@ -22,13 +22,22 @@ jobs:
run: |
latest_tag=$(git tag --list "v*" | sort -V | tail -n1)
if [ -z "$latest_tag" ]; then
next_tag="v3.0"
next_tag="v2.0"
else
base=${latest_tag#v}
major=$(echo $base | cut -d. -f1)
minor=$(echo $base | cut -d. -f2)
next_minor=$((minor+1))
next_tag="v${major}.${next_minor}"
if [ "$minor" -eq 20 ]; then
next_major=$((major + 1))
next_minor=0
else
next_major=$major
next_minor=$((minor + 1))
fi
next_tag="v${next_major}.${next_minor}"
fi
echo "next_tag=$next_tag" >> $GITHUB_ENV
echo "Next version: $next_tag"