Skip to content

Commit 2f7bf51

Browse files
committed
fix(ci): simplify release workflow to tag-push only
GITHUB_TOKEN-created tags cannot trigger workflows (GitHub security limitation). Keep it simple: developers push tags manually to release.
1 parent d9c9176 commit 2f7bf51

1 file changed

Lines changed: 2 additions & 37 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,19 @@ name: Release
22

33
on:
44
push:
5-
branches:
6-
- main
7-
paths:
8-
- 'package.json'
5+
tags:
6+
- 'v*'
97

108
permissions:
119
contents: write
1210

1311
jobs:
14-
check-version:
15-
runs-on: ubuntu-latest
16-
outputs:
17-
version: ${{ steps.check.outputs.version }}
18-
changed: ${{ steps.check.outputs.changed }}
19-
steps:
20-
- uses: actions/checkout@v6
21-
with:
22-
fetch-depth: 2
23-
24-
- name: Check version change
25-
id: check
26-
run: |
27-
CURRENT=$(jq -r .version package.json)
28-
PREVIOUS=$(git show HEAD~1:package.json 2>/dev/null | jq -r .version 2>/dev/null || echo "")
29-
echo "version=${CURRENT}" >> "$GITHUB_OUTPUT"
30-
if [ "$CURRENT" != "$PREVIOUS" ] && [ -n "$CURRENT" ]; then
31-
echo "changed=true" >> "$GITHUB_OUTPUT"
32-
else
33-
echo "changed=false" >> "$GITHUB_OUTPUT"
34-
fi
35-
36-
- name: Create tag
37-
if: steps.check.outputs.changed == 'true'
38-
run: |
39-
git tag "v${{ steps.check.outputs.version }}"
40-
git push origin "v${{ steps.check.outputs.version }}"
41-
4212
release:
43-
needs: check-version
44-
if: needs.check-version.outputs.changed == 'true'
4513
runs-on: ubuntu-latest
4614
env:
4715
GOTOOLCHAIN: auto
48-
GITHUB_REF: refs/tags/v${{ needs.check-version.outputs.version }}
4916
steps:
5017
- uses: actions/checkout@v6
51-
with:
52-
ref: v${{ needs.check-version.outputs.version }}
5318

5419
- uses: pnpm/action-setup@v4
5520

0 commit comments

Comments
 (0)