Skip to content

Commit 9170f97

Browse files
committed
Removed NPM token flow
1 parent 9ab33ed commit 9170f97

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
13+
id-token: write
1314
steps:
1415
- name: Checkout
1516
uses: actions/checkout@v4
@@ -19,6 +20,12 @@ jobs:
1920
with:
2021
bun-version: "1.3.4"
2122

23+
- name: Setup Node (for npm publish with OIDC)
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "20"
27+
registry-url: "https://registry.npmjs.org"
28+
2229
- name: Install dependencies
2330
run: bun install --frozen-lockfile
2431

@@ -34,12 +41,6 @@ jobs:
3441
publish=$(bun -e "const pkg=require('./package.json'); const res=await fetch('https://registry.npmjs.org/' + encodeURIComponent(pkg.name)); if (!res.ok) { console.log('true'); } else { const data=await res.json(); console.log(data.versions && data.versions[pkg.version] ? 'false' : 'true'); }")
3542
echo "publish=$publish" >> $GITHUB_OUTPUT
3643
37-
- name: Configure npm auth
38-
if: steps.npm.outputs.publish == 'true'
39-
env:
40-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41-
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
42-
4344
- name: Publish
4445
if: steps.npm.outputs.publish == 'true'
45-
run: bun publish --access public
46+
run: npm publish --provenance --access public

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ contract.
2020

2121
```shell
2222
bun install
23-
bun run docs:import
2423
bun run test
2524
bun run coverage
2625
bun run build:artifacts
@@ -50,12 +49,10 @@ package with `bun publish --access public` when the package version is not alrea
5049

5150
Cloudflare Pages settings:
5251

53-
- **Build command**: `bun run docs:build`
52+
- **Build command**: `bun install && bun run docs:build`
5453
- **Output directory**: `out`
5554

56-
Required secrets for automation:
57-
58-
- `NPM_TOKEN` for npm publishing
55+
npm publishing uses OIDC Trusted Publishing (no secrets required).
5956

6057
## RMRK Legos
6158

0 commit comments

Comments
 (0)