File tree Expand file tree Collapse file tree 1 file changed +38
-4
lines changed Expand file tree Collapse file tree 1 file changed +38
-4
lines changed Original file line number Diff line number Diff line change 1
- # This workflow will run tests using node and then publish a package to npm when a release is created
1
+ # This workflow will run tests using node and then publish a package when a release is created
2
2
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
3
4
4
name : Publish Package
8
8
types : [created]
9
9
10
10
jobs :
11
+ build-and-test :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+ - uses : actions/setup-node@v1
16
+ with :
17
+ node-version : 14
18
+ - run : npm ci
19
+ - run : npm run build
20
+ - run : npm test
21
+ - uses : actions/upload-artifact@v2
22
+ with :
23
+ name : dist
24
+ path : dist
25
+
11
26
publish-npm :
27
+ needs : build-and-test
12
28
runs-on : ubuntu-latest
13
29
steps :
14
30
- uses : actions/checkout@v2
17
33
node-version : 14
18
34
registry-url : https://registry.npmjs.org/
19
35
- run : npm ci
20
- - run : npm test
21
- - run : npm run build
36
+ - uses : actions/download-artifact@v2
37
+ with :
38
+ name : dist
39
+ - run : npm publish
40
+ env :
41
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
42
+
43
+ publish-gpr :
44
+ needs : build-and-test
45
+ runs-on : ubuntu-latest
46
+ steps :
47
+ - uses : actions/checkout@v2
48
+ - uses : actions/setup-node@v1
49
+ with :
50
+ node-version : 14
51
+ registry-url : https://npm.pkg.github.com/
52
+ - run : npm ci
53
+ - uses : actions/download-artifact@v2
54
+ with :
55
+ name : dist
22
56
- run : npm publish
23
57
env :
24
- NODE_AUTH_TOKEN : ${{secrets.npm_token }}
58
+ NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments