File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 5
5
tags :
6
6
- ' v*'
7
7
workflow_dispatch :
8
+ inputs :
9
+ version :
10
+ description : ' Version to release'
11
+ required : true
8
12
9
13
jobs :
10
14
release :
23
27
- name : Install dependencies
24
28
run : npm install
25
29
30
+ - name : Extract version from tag or dispatch
31
+ id : get_version
32
+ run : |
33
+ if [ "${{ github.event_name }}" == "push" ]; then
34
+ echo "Version from tag ${GITHUB_REF##*/}"
35
+ echo "::set-output name=version::${GITHUB_REF##*/v}"
36
+ elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
37
+ echo "Version from dispatch input ${{ github.event.inputs.version }}"
38
+ echo "::set-output name=version::${{ github.event.inputs.version }}"
39
+ fi
40
+
41
+ - name : Update version in package.json
42
+ run : npm version ${{ steps.get_version.outputs.version }} --no-git-tag-version
43
+
26
44
- name : Build
27
45
run : npm run build
28
46
37
55
- name : Publish
38
56
env :
39
57
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
40
- run : npm publish -r - -access public --no-git-checks
58
+ run : npm publish --access public --no-git-checks
You can’t perform that action at this time.
0 commit comments