Skip to content

Commit 21db150

Browse files
Workflow: Publish - Attempt to switch to new npm trusted publishing
@see https://docs.npmjs.com/trusted-publishers
1 parent 646bb06 commit 21db150

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Publish NPM package
22
permissions:
3+
# Note: Because this workflow is call from release, the
4+
# trusted publisher workflow will be release.yml
5+
# see https://docs.npmjs.com/trusted-publishers
6+
id-token: write
37
contents: write
48
on:
59
# Release workflow calls this after shared test step succeeds
@@ -12,15 +16,16 @@ jobs:
1216
uses: actions/checkout@v4
1317
with:
1418
fetch-depth: 0
15-
- name: Setup Bun
16-
uses: oven-sh/setup-bun@v2
19+
- name: Setup NPM
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '24'
23+
registry-url: 'https://registry.npmjs.org'
1724
- name: Install dependencies
18-
run: bun install
25+
run: npm install
1926
- name: Build NPM package
20-
run: bun run build:npm
27+
run: npm run build:npm
2128
- name: Publish NPM package
2229
run: |
2330
cd publish/npm
24-
bun publish --access public
25-
env:
26-
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
npm publish --access public

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Release
22
permissions:
3+
id-token: write
34
contents: write
45
on:
56
push:

0 commit comments

Comments
 (0)