Skip to content

Commit dc45cb0

Browse files
Update Create-NewReleases.yml
1 parent 47792ff commit dc45cb0

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

.github/workflows/Create-NewReleases.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)