Skip to content

Commit 14831bf

Browse files
danbot315Daniel Clayton
andauthored
ci: switch release workflow to npm trusted publishing (OIDC) (#18)
Co-authored-by: Daniel Clayton <dan@Daniels-Mac-mini.local>
1 parent 89c96f3 commit 14831bf

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ concurrency:
1010

1111
permissions:
1212
contents: write
13+
id-token: write
1314

1415
jobs:
1516
release:
@@ -25,6 +26,12 @@ jobs:
2526
with:
2627
bun-version: 1.2.22
2728

29+
- name: Setup Node.js for npm Trusted Publishing
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
registry-url: 'https://registry.npmjs.org'
34+
2835
- name: Install dependencies
2936
run: bun install --frozen-lockfile
3037

@@ -46,19 +53,11 @@ jobs:
4653
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4754
run: bun run changeset:version
4855

49-
- name: Configure npm auth for npmjs
50-
if: steps.changesets.outputs.count != '0'
51-
env:
52-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
53-
run: |
54-
echo "registry=https://registry.npmjs.org" >> ~/.npmrc
55-
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
56-
57-
- name: Publish packages
56+
- name: Publish packages (npm trusted publishing)
5857
if: steps.changesets.outputs.count != '0'
5958
env:
6059
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
60+
NPM_CONFIG_PROVENANCE: true
6261
run: bun run changeset:publish
6362

6463
- name: Commit version updates to main

0 commit comments

Comments
 (0)