File tree 1 file changed +50
-6
lines changed
1 file changed +50
-6
lines changed Original file line number Diff line number Diff line change 1
1
name : Publish
2
+
2
3
on :
3
4
release :
4
5
types : [created]
6
+
5
7
jobs :
6
8
publish-npm :
9
+ name : Publish to npm
7
10
runs-on : ubuntu-latest
11
+ permissions :
12
+ contents : read
13
+ id-token : write
8
14
steps :
9
- - name : Checkout the project
10
- uses : actions/checkout@v3
11
- - name : Use Node.js 16.x (LTS)
12
- uses : actions/setup-node@v3
15
+ - uses : actions/checkout@v3
16
+ - uses : actions/setup-node@v3
13
17
with :
14
- node-version : 16.x
18
+ node-version : 18
15
19
registry-url : https://registry.npmjs.org/
16
20
cache : npm
17
21
- run : npm ci
18
22
- run : npm test
19
23
- run : npm version ${TAG_NAME} --git-tag-version=false
20
24
env :
21
25
TAG_NAME : ${{ github.event.release.tag_name }}
22
- - run : npm whoami; npm publish --access public
26
+
27
+ # Provenance beta builds
28
+ # Remove when stable
29
+ - name : Clone npm
30
+ uses : actions/checkout@v3
31
+ with :
32
+ repository : npm/cli
33
+ ref : provenance
34
+ path : npm
35
+ - name : Link npm
36
+ run : |
37
+ cd npm
38
+ node . link
39
+ cd ..
40
+ npm version
41
+ # Provenance beta builds
42
+ # Remove when stable
43
+
44
+ - run : npm whoami; npm --ignore-scripts publish --provenance --access public
23
45
env :
24
46
NODE_AUTH_TOKEN : ${{secrets.npm_token}}
47
+ publish-github :
48
+ name : Publish to GitHub Packages
49
+ runs-on : ubuntu-latest
50
+ permissions :
51
+ contents : read
52
+ packages : write
53
+ steps :
54
+ - uses : actions/checkout@v3
55
+ - uses : actions/setup-node@v3
56
+ with :
57
+ node-version : 18
58
+ registry-url : https://npm.pkg.github.com
59
+ cache : npm
60
+ scope : ' @github'
61
+ - run : npm ci
62
+ - run : npm test
63
+ - run : npm version ${TAG_NAME} --git-tag-version=false
64
+ env :
65
+ TAG_NAME : ${{ github.event.release.tag_name }}
66
+ - run : npm --ignore-scripts publish --access public
67
+ env :
68
+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments