Skip to content

Commit 5681aee

Browse files
committed
fix: update npm-publish workflow to improve job structure and consistency
1 parent 4b34569 commit 5681aee

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

‎.github/workflows/npm-publish.yml‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,35 @@ name: Node.js build and publish package
22

33
on:
44
release:
5-
types: [ created ]
5+
types: [created]
66

77
jobs:
8-
build:
8+
verify:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
12-
- uses: actions/setup-node@v3
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
1313
with:
1414
node-version: 20
15-
- run: npm i
15+
cache: npm
16+
- run: npm ci
17+
- run: npm run lint
18+
- run: npm run typecheck
19+
- run: npm test
20+
- run: npm run build
1621

1722
publish-npm:
18-
needs: build
23+
needs: verify
1924
runs-on: ubuntu-latest
2025
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-node@v3
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
2328
with:
2429
node-version: 20
2530
registry-url: https://registry.npmjs.org/
26-
- run: npm i
31+
cache: npm
32+
- run: npm ci
2733
- run: npm run build
2834
- run: npm publish
2935
env:
30-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)