Skip to content

Commit 4b51fc3

Browse files
authored
Merge pull request #43 from Flux159/pr43
Updating cd.yml to use npm trusted publishers.
2 parents 685792b + fe7539f commit 4b51fc3

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/cd.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- v*
77

8+
permissions:
9+
id-token: write
10+
contents: write
11+
812
jobs:
913
deploy:
1014
runs-on: ubuntu-latest
@@ -59,13 +63,19 @@ jobs:
5963
- name: Build For production
6064
run: bun run build
6165

66+
- name: Setup Node.js for NPM publish
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: "20"
70+
registry-url: "https://registry.npmjs.org"
71+
72+
- name: Update npm for OIDC support
73+
run: npm install -g npm@latest
74+
6275
- name: Publish to NPM
63-
run: |
64-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
65-
echo "//registry.npmjs.org/:always-auth=true" >> ~/.npmrc
66-
npm publish
6776
env:
68-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
NPM_CONFIG_PROVENANCE: true
78+
run: npm publish --provenance
6979

7080
- name: Set up QEMU
7181
uses: docker/setup-qemu-action@v3

0 commit comments

Comments
 (0)