File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+ name : Node.js Package
5+
6+ on :
7+ release :
8+ types : [published]
9+ workflow_dispatch :
10+
11+ permissions :
12+ id-token : write # Required for OIDC
13+ contents : read
14+
15+ jobs :
16+ build :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v5
20+ - uses : actions/setup-node@v4
21+ with :
22+ node-version : 20
23+ - run : npm install
24+ - run : npm test
25+
26+ publish-npm :
27+ environment : deploy
28+ needs : build
29+ runs-on : ubuntu-latest
30+ steps :
31+ - uses : actions/checkout@v5
32+ - uses : actions/setup-node@v6
33+ with :
34+ node-version : 20
35+ registry-url : ' https://registry.npmjs.org/'
36+ - name : Update npm
37+ run : npm install -g npm@latest
38+ - run : npm install
39+ - run : npm run build --if-present
40+ - run : npm test
41+ - run : npm publish
42+
43+ publish-gh-pkgs :
44+ needs : build
45+ runs-on : ubuntu-latest
46+ steps :
47+ - uses : actions/checkout@v5
48+ - uses : actions/setup-node@v6
49+ with :
50+ node-version : 20
51+ registry-url : ' https://npm.pkg.github.com'
52+ - name : Update npm
53+ run : npm install -g npm@latest
54+ - run : npm install
55+ - run : npm run build --if-present
56+ - run : npm test
57+ - run : npm publish
58+ env :
59+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments