Skip to content

Commit b4932d5

Browse files
Update Create-NewReleases.yml
1 parent f12514f commit b4932d5

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

.github/workflows/Create-NewReleases.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,37 @@ jobs:
2121
id: nextver
2222
run: |
2323
TAG=$(git tag --sort=-v:refname | head -n 1)
24-
if [[ $TAG == '' ]]; then TAG='v1.0.4'; fi
25-
NEXT_TAG=$(echo $TAG | awk -F. '{print $1"."$2"."$3+1}')
24+
if [[ $TAG == '' ]]; then
25+
TAG='v0.1.0' # Start from v0.1.0 if no tags are found
26+
fi
27+
MAJOR=$(echo $TAG | cut -d '.' -f 1 | cut -c 2-)
28+
MINOR=$(echo $TAG | cut -d '.' -f 2)
29+
PATCH=$(echo $TAG | cut -d '.' -f 3)
30+
31+
if [[ $PATCH -eq 9 ]]; then
32+
PATCH=0
33+
if [[ $MINOR -eq 9 ]]; then
34+
MINOR=0
35+
MAJOR=$((MAJOR+1))
36+
else
37+
MINOR=$((MINOR+1))
38+
fi
39+
else
40+
PATCH=$((PATCH+1))
41+
fi
42+
43+
NEXT_TAG="v$MAJOR.$MINOR.$PATCH"
2644
echo "Next version tag: $NEXT_TAG"
2745
echo "tag=$NEXT_TAG" >> $GITHUB_OUTPUT
2846
- name: Create and Push Tag
2947
run: |
3048
git tag ${{ steps.nextver.outputs.tag }}
3149
git push origin ${{ steps.nextver.outputs.tag }}
32-
- name: Create Release
33-
uses: marvinpinto/action-automatic-releases@latest
50+
- name: Create Release with Automated Release Notes
51+
uses: softprops/action-gh-release@v0.1.15
3452
with:
35-
repo_token: ${{ secrets.GITHUB_TOKEN }}
36-
automatic_release_tag: ${{ steps.nextver.outputs.tag }}
53+
token: ${{ secrets.GITHUB_TOKEN }}
54+
tag_name: ${{ steps.nextver.outputs.tag }}
55+
name: "Release ${{ steps.nextver.outputs.tag }}"
3756
prerelease: false
38-
title: Release ${{ steps.nextver.outputs.tag }}
57+
generate_release_notes: true

0 commit comments

Comments
 (0)