diff --git a/.github/workflows/release-major.yml b/.github/workflows/release-major.yml new file mode 100644 index 0000000..04eeffa --- /dev/null +++ b/.github/workflows/release-major.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f54d8ab..3867a05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,10 @@ name: Release on: push: - branches: - - master + branches-ignore: + - '!master' + tags-ignore: + - '**' jobs: release: diff --git a/.releaserc b/.releaserc index 27c6c05..015e93c 100644 --- a/.releaserc +++ b/.releaserc @@ -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}" } ] ]