Skip to content

Commit 8c8ee10

Browse files
authored
Update npm-publish.yml
1 parent aa67929 commit 8c8ee10

File tree

1 file changed

+46
-11
lines changed

1 file changed

+46
-11
lines changed

.github/workflows/npm-publish.yml

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,58 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v3
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
1619
with:
17-
node-version: 18.20.3
18-
- run: npm ci
19-
- run: npm test
20+
node-version: 20
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Run tests
26+
run: npm test
2027

2128
publish-npm:
2229
needs: build
2330
runs-on: ubuntu-latest
2431
steps:
25-
- uses: actions/checkout@v4
26-
- uses: actions/setup-node@v3
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Node.js
36+
uses: actions/setup-node@v3
2737
with:
28-
node-version: 18.20.3
38+
node-version: 20
2939
registry-url: https://registry.npmjs.org/
30-
- run: npm ci
31-
- run: npm publish
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Publish to npm
45+
run: npm publish
46+
env:
47+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
49+
publish-github:
50+
needs: build
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
56+
- name: Set up Node.js
57+
uses: actions/setup-node@v3
58+
with:
59+
node-version: 20
60+
registry-url: https://npm.pkg.github.com/
61+
62+
- name: Install dependencies
63+
run: npm ci
64+
65+
- name: Publish to GitHub Packages
66+
run: npm publish
3267
env:
33-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
68+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)