File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 11name : Publish to npm
22
33on :
4+ # Manual trigger from GitHub UI
5+ workflow_dispatch :
6+ inputs :
7+ version :
8+ description : ' Version bump type'
9+ required : true
10+ default : ' patch'
11+ type : choice
12+ options :
13+ - patch
14+ - minor
15+ - major
16+
17+ # Auto-trigger on version tags (for local publish.sh script)
418 push :
519 tags :
620 - ' v*'
@@ -10,13 +24,34 @@ jobs:
1024 runs-on : ubuntu-latest
1125 steps :
1226 - uses : actions/checkout@v4
27+ with :
28+ token : ${{ secrets.GITHUB_TOKEN }}
1329
1430 - uses : actions/setup-node@v4
1531 with :
1632 node-version : ' 20'
1733 registry-url : ' https://registry.npmjs.org'
1834 cache : ' npm'
1935
36+ - name : Configure git
37+ if : github.event_name == 'workflow_dispatch'
38+ run : |
39+ git config user.name "github-actions[bot]"
40+ git config user.email "github-actions[bot]@users.noreply.github.com"
41+
42+ - name : Bump version
43+ if : github.event_name == 'workflow_dispatch'
44+ run : |
45+ cd packages/cli
46+ npm version ${{ inputs.version }} --no-git-tag-version
47+ VERSION=$(node -p "require('./package.json').version")
48+ cd ../..
49+ git add packages/cli/package.json
50+ git commit -m "Release v${VERSION}"
51+ git tag "v${VERSION}"
52+ git push
53+ git push --tags
54+
2055 - name : Install dependencies
2156 run : npm ci
2257
You can’t perform that action at this time.
0 commit comments