generated from vrchat-community/template-package
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
ci: add auto-release-tagging workflow
1 parent
e72c55c
commit 1259877
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Tag releases | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get current version | ||
run: | | ||
echo current_version=$(jq -r .version package.json) >> $GITHUB_ENV | ||
- name: Check if version is tagged | ||
id: check_tagged | ||
run: | | ||
if git tag -l $current_version; then | ||
echo "Version $current_version is already tagged" | ||
echo "need_tag=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "Version $current_version is not tagged" | ||
echo "need_tag=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Tag version | ||
if: steps.check_tagged.outputs.need_tag == 'true' | ||
run: | | ||
git config user.name "Github Actions" | ||
git config user.email "[email protected]" | ||
git tag $current_version | ||
git push origin $current_version |