File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed
Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -29,30 +29,32 @@ jobs:
2929 id : nextver
3030 run : |
3131 if [[ -f version.txt ]]; then
32- TAG =$(cat version.txt)
32+ NEXT_TAG =$(cat version.txt)
3333 else
34- TAG =$(git tag --sort=-v:refname | head -n 1)
34+ CURRENT_TAG =$(git tag --sort=-v:refname | head -n 1)
3535 if [[ $TAG == '' ]]; then
36- TAG ='v0.1.0' # Start from v0.1.0 if no tags are found
36+ CURRENT_TAG ='v0.1.0' # Start from v0.1.0 if no tags are found
3737 fi
38- fi
39- MAJOR=$(echo $TAG | cut -d '.' -f 1 | cut -c 2-)
40- MINOR=$(echo $TAG | cut -d '.' -f 2)
41- PATCH=$(echo $TAG | cut -d '.' -f 3)
4238
43- if [[ $PATCH -eq 9 ]]; then
44- PATCH=0
45- if [[ $MINOR -eq 9 ]]; then
46- MINOR=0
47- MAJOR=$((MAJOR+1))
39+ MAJOR=$(echo $CURRENT_TAG | cut -d '.' -f 1 | cut -c 2-)
40+ MINOR=$(echo $CURRENT_TAG | cut -d '.' -f 2)
41+ PATCH=$(echo $CURRENT_TAG | cut -d '.' -f 3)
42+
43+ if [[ $PATCH -eq 9 ]]; then
44+ PATCH=0
45+ if [[ $MINOR -eq 9 ]]; then
46+ MINOR=0
47+ MAJOR=$((MAJOR+1))
48+ else
49+ MINOR=$((MINOR+1))
50+ fi
4851 else
49- MINOR =$((MINOR +1))
52+ PATCH =$((PATCH +1))
5053 fi
51- else
52- PATCH=$(( PATCH+1))
54+
55+ NEXT_TAG="v$MAJOR.$MINOR.$ PATCH"
5356 fi
5457
55- NEXT_TAG="v$MAJOR.$MINOR.$PATCH"
5658 echo "Next version tag: $NEXT_TAG"
5759 echo "tag=$NEXT_TAG" >> $GITHUB_OUTPUT
5860
You can’t perform that action at this time.
0 commit comments