Skip to content

Commit 6306dda

Browse files
committed
fix: update major version tag as post-release step
Move major tag update (e.g. v6) into the release workflow as a conditional step, gated on semantic-release actually publishing. This avoids the GITHUB_TOKEN limitation where events from the default token don't trigger separate workflows. Also reverts @semantic-release/github from .releaserc since we no longer rely on the release event to trigger a separate workflow.
1 parent ffb309f commit 6306dda

3 files changed

Lines changed: 10 additions & 25 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
- name: Run Tests
2929
run: npm test --if-present
3030
- name: Release
31+
id: semantic
3132
uses: cycjimmy/semantic-release-action@v6
3233
with:
3334
semantic_version: 24
@@ -43,3 +44,11 @@ jobs:
4344
GIT_COMMITTER_NAME: github-actions
4445
GIT_COMMITTER_EMAIL: github-actions@github.com
4546
CI: true
47+
- name: Update major version tag
48+
if: steps.semantic.outputs.new_release_published == 'true'
49+
run: |
50+
MAJOR="v${{ steps.semantic.outputs.new_release_major_version }}"
51+
TAG="v${{ steps.semantic.outputs.new_release_version }}"
52+
echo "Updating $MAJOR tag to point to $TAG"
53+
git tag -f "$MAJOR" "$TAG"
54+
git push -f origin "$MAJOR"

.github/workflows/update-major-tag.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.releaserc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
{
1818
"assets": ["docs/CHANGELOG.md", "package.json"]
1919
}
20-
],
21-
"@semantic-release/github"
20+
]
2221
]
2322
}

0 commit comments

Comments
 (0)