File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - ' v*'
7+ workflow_dispatch :
8+ inputs :
9+ tag :
10+ description : ' Tag to release (vX.Y.Z)'
11+ required : true
12+ type : string
713
814jobs :
915 release :
1016 runs-on : windows-latest
1117 permissions :
1218 contents : write
19+ env :
20+ RELEASE_TAG : ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
1321
1422 steps :
1523 - uses : actions/checkout@v4
24+ with :
25+ ref : ${{ env.RELEASE_TAG }}
1626
1727 - name : Use Node.js 22.x
1828 uses : actions/setup-node@v4
2535
2636 - name : Check Version
2737 run : |
28- $tag = $env:GITHUB_REF -replace 'refs/tags/ v', ''
38+ $tag = $env:RELEASE_TAG -replace '^ v', ''
2939 $pkg = Get-Content package.json | ConvertFrom-Json
3040 if ($pkg.version -ne $tag) {
3141 Write-Error "Version mismatch: Tag $tag vs Package $($pkg.version)"
6272 env :
6373 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6474 run : |
65- $tag = $env:GITHUB_REF -replace 'refs/tags/', ''
75+ $tag = $env:RELEASE_TAG
6676 $headers = @{
6777 Authorization = "Bearer $env:GITHUB_TOKEN"
6878 Accept = "application/vnd.github+json"
8999
90100 - name : Release
91101 uses : softprops/action-gh-release@v2
92- if : startsWith(github.ref, 'refs/tags/')
102+ if : ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') }}
93103 with :
104+ tag_name : ${{ env.RELEASE_TAG }}
94105 files : artifacts/*
95106 generate_release_notes : true
You can’t perform that action at this time.
0 commit comments