-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from fermyon/release-tags
release major tag on new release
- Loading branch information
Showing
1 changed file
with
22 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,22 @@ | ||
name: Tag the new release | ||
on: | ||
push: | ||
tags: "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: write | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- run: | | ||
echo "GITHUB_REF is $GITHUB_REF" | ||
MAJOR_TAG=$(echo -n $GITHUB_REF | sed -e "s/^refs\/tags\/\(v[0-9]\+\)\.[0-9]\+.[0-9]\+$/\1/g") | ||
[[ "$MAJOR_TAG" =~ ^v[0-9]+$ ]] || (echo "$MAJOR_TAG does not seem like a valid major tag" && exit 1) | ||
echo "creating (or moving) major tag $MAJOR_TAG to commit sha $GITHUB_SHA" | ||
git tag -f $MAJOR_TAG && git push -f origin tags/$MAJOR_TAG |