Skip to content

Commit b8c0499

Browse files
committed
chore: Add workflow
1 parent 1e0de0f commit b8c0499

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Update major tag
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-18.04
10+
steps:
11+
12+
- uses: actions/checkout@v2
13+
14+
- name: Update major tag
15+
if: github.event.release.prerelease == false
16+
run: |
17+
git config user.name "${GITHUB_ACTOR}"
18+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
19+
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
20+
export TAG_NAME="${GITHUB_REF##refs/tags/}"
21+
export TAG_MAJOR="${TAG_NAME%%.*}"
22+
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || git tag -d "${TAG_MAJOR}" ; git push --delete origin "${TAG_MAJOR}"
23+
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || true
24+
git push origin "${TAG_MAJOR}"

0 commit comments

Comments
 (0)