Skip to content

Commit 8db64f6

Browse files
authored
Merge pull request #77 from Wei18/feat/use-GitHubSwiftActions-release
Update Release.yml
2 parents 27dcaff + e14ce45 commit 8db64f6

File tree

1 file changed

+7
-33
lines changed

1 file changed

+7
-33
lines changed

.github/workflows/Release.yml

+7-33
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,10 @@ jobs:
4949
permissions:
5050
contents: write
5151
steps:
52-
- name: Get latest version
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
run: |
56-
LATEST_VERSION=$(gh release view --repo ${{ github.repository }} --json tagName --jq .tagName)
57-
echo "Latest release version: $LATEST_VERSION"
58-
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
59-
60-
- name: Bump patch version
61-
run: |
62-
# Extract version numbers
63-
VERSION=${LATEST_VERSION#v}
64-
MAJOR=$(echo $VERSION | cut -d. -f1)
65-
MINOR=$(echo $VERSION | cut -d. -f2)
66-
PATCH=$(echo $VERSION | cut -d. -f3)
67-
68-
# Bump the patch number
69-
PATCH=$((PATCH+1))
70-
71-
# Form new version
72-
NEW_VERSION="v$MAJOR.$MINOR.$PATCH"
73-
echo "New version: $NEW_VERSION"
74-
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
75-
76-
- name: Create new GitHub release
77-
env:
78-
GIT_REF: ${{ needs.create-git-branch-release.outputs.branch }}
79-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
run: |
81-
gh release create $NEW_VERSION \
82-
--repo ${{ github.repository }} \
83-
--generate-notes \
84-
--target "$GIT_REF"
52+
- uses: Wei18/GitHubSwiftActions/Actions/[email protected]
53+
with:
54+
owner: ${{ github.repository_owner }}
55+
repo: ${{ github.event.repository.name }}
56+
token: ${{ secrets.GITHUB_TOKEN }}
57+
ref: ${{ needs.create-git-branch-release.outputs.branch }}
58+
type: "patch"

0 commit comments

Comments
 (0)