Skip to content

Commit 99f0648

Browse files
committed
fix: update npm publish workflow for consistency and clarity
1 parent b891d39 commit 99f0648

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

.github/workflows/npm-publish.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,29 @@ on:
44
release:
55
types: [published]
66

7-
jobs:
7+
jobs:
88
build:
99
runs-on: ubuntu-latest
10-
1110
permissions:
12-
id-token: write
1311
contents: read
14-
12+
id-token: write
1513
steps:
16-
- uses: actions/checkout@v4
17-
18-
- uses: actions/setup-node@v4
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
1916
with:
20-
node-version: '20'
17+
node-version: '18.x'
2118
registry-url: 'https://registry.npmjs.org'
22-
23-
- run: npm ci
24-
25-
- run: npm run build
26-
27-
- name: Authenticate to npm
28-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
29-
30-
- name: Publish to npm (OIDC)
31-
run: npm publish --access public
19+
cache: "npm"
20+
- name: "Install latest npm version"
21+
run: npm install -g npm
22+
- name: "print version"
23+
run: npm --v
24+
- name: "Install packages"
25+
run: |
26+
npm i
27+
npm ci
28+
- name: "publish package"
29+
uses: JS-DevTools/npm-publish@v3
30+
with:
31+
token: ${{ secrets.NPM_TOKEN }}
32+
provenance: true

0 commit comments

Comments
 (0)