File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : NPM publish
2
+
3
+ on :
4
+ release :
5
+ types : [created]
6
+ workflow_dispatch :
7
+ inputs :
8
+ version :
9
+ description : ' Package version'
10
+ required : true
11
+ default : v2.0.0
12
+
13
+ jobs :
14
+ publish-npm :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - uses : actions/checkout@v2
18
+ - name : Set version for release trigger
19
+ uses :
allenevans/[email protected]
20
+ if : ${{ github.event_name == 'release' }}
21
+ with :
22
+ PACKAGE_VERSION : ${{github.event.release.tag_name}}
23
+ - name : Set version for workflow dispatch
24
+ uses :
allenevans/[email protected]
25
+ if : ${{ github.event_name == 'workflow_dispatch' }}
26
+ with :
27
+ PACKAGE_VERSION : ${{ github.event.inputs.version }}
28
+ - uses : actions/setup-node@v2
29
+ with :
30
+ node-version : 12
31
+ registry-url : https://registry.npmjs.org/
32
+ - run : npm ci
33
+ - run : npm version ${{env.PACKAGE_VERSION}}
34
+ - run : npm publish --access public
35
+ env :
36
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
You can’t perform that action at this time.
0 commit comments