Skip to content

Commit

Permalink
Merge pull request #25 from fermyon/release-tags
Browse files Browse the repository at this point in the history
release major tag on new release
  • Loading branch information
rajatjindal authored Mar 29, 2023
2 parents 389adbd + a4e9968 commit 786adf5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release-tag.yml
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

0 comments on commit 786adf5

Please sign in to comment.