Skip to content

Commit bb0a1a3

Browse files
committed
ci: use npm ci before publishing
1 parent a409803 commit bb0a1a3

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

.github/workflows/nodejs.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,53 @@
44
name: Node.js
55
on:
66
push:
7-
branches: [ master ]
7+
branches: [master]
88
pull_request:
9-
branches: [ master ]
9+
branches: [master]
1010
jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
1515
node-version: [16.x, 18.x, 20.x, 22.x]
1616
steps:
17-
- uses: actions/checkout@v4
18-
- name: Use Node.js ${{ matrix.node-version }}
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: ${{ matrix.node-version }}
22-
- run: npm install
23-
- run: npm run test
17+
- uses: actions/checkout@v4
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- run: npm install
23+
- run: npm run test
2424
test_legacy:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
2828
node-version: [14.x]
2929
steps:
30-
- uses: actions/checkout@v4
31-
- name: Use Node.js ${{ matrix.node-version }}
32-
uses: actions/setup-node@v4
33-
with:
34-
node-version: ${{ matrix.node-version }}
35-
- run: |
36-
cwd=`pwd`
37-
for pkg in packages/*/package.json; do
38-
cd $cwd/`dirname $pkg`
39-
npm install
40-
npm run test:legacy;
41-
done
30+
- uses: actions/checkout@v4
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
- run: |
36+
cwd=`pwd`
37+
for pkg in packages/*/package.json; do
38+
cd $cwd/`dirname $pkg`
39+
npm install
40+
npm run test:legacy;
41+
done
4242
publish:
4343
needs: [test, test_legacy]
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v4
47-
with:
48-
fetch-depth: 0
49-
- uses: actions/setup-node@v4
50-
with:
51-
node-version: '20.x'
52-
registry-url: 'https://registry.npmjs.org'
53-
- run: npm install
54-
- run: npm run publish
55-
env:
56-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
- uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: "20.x"
52+
registry-url: "https://registry.npmjs.org"
53+
- run: npm ci
54+
- run: npm run publish
55+
env:
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)