7676 gh release upload "${{ steps.release.outputs.tag_name }}" \
7777 cdn/claudius.iife.js cdn/claudius.css --clobber
7878
79- # On merge, publish the widget to npm. Runs against the default checkout
80- # (main at the released commit), which carries the version release-please
81- # just bumped. --provenance signs the package via the id-token permission.
79+ # On merge, publish to npm via Trusted Publishing (OIDC) — no long-lived
80+ # NPM_TOKEN. Each package has a trusted publisher configured at npmjs.com
81+ # matching this repo + this workflow filename (release-please.yml); the
82+ # id-token: write permission above lets npm mint a short-lived token.
83+ # Trusted Publishing needs npm >= 11.5.1 (newer than Node's bundled npm),
84+ # so we upgrade npm first. Provenance is generated automatically. Runs
85+ # against the default checkout (main at the released commit), which carries
86+ # the version release-please just bumped.
8287 - name : Setup pnpm (npm publish)
8388 if : ${{ steps.release.outputs.release_created }}
8489 uses : pnpm/action-setup@v4
@@ -89,16 +94,18 @@ jobs:
8994 if : ${{ steps.release.outputs.release_created }}
9095 uses : actions/setup-node@v4
9196 with :
92- node-version : 20
97+ node-version : 22
9398 registry-url : https://registry.npmjs.org
9499 cache : pnpm
95100 cache-dependency-path : widget/pnpm-lock.yaml
96101
102+ - name : Upgrade npm for trusted publishing
103+ if : ${{ steps.release.outputs.release_created }}
104+ run : npm install -g npm@latest
105+
97106 - name : Build and publish widget
98107 if : ${{ steps.release.outputs.release_created }}
99108 working-directory : widget
100- env :
101- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
102109 run : |
103110 pnpm install --frozen-lockfile
104111 pnpm build
@@ -107,8 +114,6 @@ jobs:
107114 - name : Build and publish create-claudius
108115 if : ${{ steps.release.outputs.release_created }}
109116 working-directory : create-claudius
110- env :
111- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
112117 run : |
113118 pnpm install --frozen-lockfile
114119 pnpm build
0 commit comments