File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 runs-on : ubuntu-latest
1111 permissions :
1212 contents : read
13+ id-token : write
1314 steps :
1415 - name : Checkout
1516 uses : actions/checkout@v4
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
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
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ contract.
2020
2121``` shell
2222bun install
23- bun run docs:import
2423bun run test
2524bun run coverage
2625bun run build:artifacts
@@ -50,12 +49,10 @@ package with `bun publish --access public` when the package version is not alrea
5049
5150Cloudflare 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
You can’t perform that action at this time.
0 commit comments