Skip to content

Commit

Permalink
feat(TECH): major version tag (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenquanheycar authored Apr 17, 2024
1 parent 61875ac commit 188700d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release-major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Update major version tag

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
major-version-tag:
runs-on: ubuntu-latest
steps:

- name: Update major version tag
env:
GH_TOKEN: ${{ secrets.VERSIONING_TOKEN }}
REPO: ${{ github.repository }}
TAG: "${{ github.event.ref }}"
COMMIT_SHA: "${{ github.event.after }}"
run: |
_major_tag="$(echo ${TAG} | cut -d/ -f3 | cut -d. -f1)"
echo "Attempting to delete major version tag ${_major_tag}..."
gh release delete "${_major_tag}" --repo ${REPO} --cleanup-tag -y || echo "No major version tag to delete"
sleep 5 # https://github.com/cli/cli/issues/8458
echo "Creating major version tag ${_major_tag} for commit ${COMMIT_SHA}..."
gh release create "${_major_tag}" --repo ${REPO} --target ${COMMIT_SHA} --generate-notes --latest
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ name: Release

on:
push:
branches:
- master
branches-ignore:
- '!master'
tags-ignore:
- '**'

jobs:
release:
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
"message": "chore(release): version ${nextRelease.version}\n\n${nextRelease.notes}"
}
]
]
Expand Down

0 comments on commit 188700d

Please sign in to comment.