File tree Expand file tree Collapse file tree 3 files changed +1898
-8699
lines changed Expand file tree Collapse file tree 3 files changed +1898
-8699
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 GitHub Packages when a release is created
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
+
4
+ name : Publish to npm
5
+
6
+ on :
7
+ release :
8
+ types : [published]
9
+
10
+ jobs :
11
+ build :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+ - uses : actions/setup-node@v4
16
+ with :
17
+ node-version : 22
18
+ - run : npm ci
19
+ - run : npm test
20
+
21
+ publish-npm :
22
+ needs : build
23
+ runs-on : ubuntu-latest
24
+ permissions :
25
+ id-token : write
26
+ steps :
27
+ - uses : actions/checkout@v4
28
+ - uses : actions/setup-node@v4
29
+ with :
30
+ node-version : 22.x
31
+ registry-url : ' https://registry.npmjs.org'
32
+ cache : ' npm'
33
+ - run : npm ci
34
+ - run : npm version ${TAG_NAME} --git-tag-version=false
35
+ env :
36
+ TAG_NAME : ${{ github.ref_name }}
37
+ - run : npm publish --provenance --access public --tag next
38
+ if : " github.event.release.prerelease"
39
+ env :
40
+ NODE_AUTH_TOKEN : ${{ secrets.npm_secret }}
41
+ - run : npm publish --provenance --access public
42
+ if : " !github.event.release.prerelease"
43
+ env :
44
+ NODE_AUTH_TOKEN : ${{ secrets.npm_secret }}
You can’t perform that action at this time.
0 commit comments