|
1 | 1 | # Publishes create-clanker-support to npm. Trigger by pushing a tag: |
2 | 2 | # create-clanker-support@1.0.0 |
3 | | -# Requires an NPM_TOKEN secret (npm automation token with publish rights to the |
4 | | -# unscoped `create-clanker-support` name). The tag version must match |
5 | | -# packages/create-clanker-support/package.json — asserted before publish. |
| 3 | +# Auth is OIDC trusted publishing (no token secret): configure a trusted |
| 4 | +# publisher on the npm package (Settings -> Trusted publisher) pointing at |
| 5 | +# org: theopenco repo: clankersupport-templates |
| 6 | +# workflow: release-cli.yml environment: (none) |
| 7 | +# npm can only add a trusted publisher to an EXISTING package, so the very |
| 8 | +# first publish must be done manually (`npm publish --access public` from |
| 9 | +# packages/create-clanker-support) — every release after that is OIDC. |
| 10 | +# The tag version must match packages/create-clanker-support/package.json — |
| 11 | +# asserted before publish. |
6 | 12 | name: Release CLI |
7 | 13 |
|
8 | 14 | on: |
|
13 | 19 | jobs: |
14 | 20 | publish: |
15 | 21 | runs-on: ubuntu-latest |
| 22 | + permissions: |
| 23 | + contents: read |
| 24 | + id-token: write # OIDC token for npm trusted publishing |
16 | 25 | defaults: |
17 | 26 | run: |
18 | 27 | working-directory: packages/create-clanker-support |
|
22 | 31 | with: |
23 | 32 | node-version: 22 |
24 | 33 | registry-url: https://registry.npmjs.org |
| 34 | + # Node 22 bundles npm 10; trusted publishing needs npm >= 11.5.1. |
| 35 | + - run: npm install -g npm@11 |
25 | 36 | - name: Assert tag matches package version |
26 | 37 | run: | |
27 | 38 | TAG_VERSION="${GITHUB_REF_NAME#create-clanker-support@}" |
|
32 | 43 | run: node index.mjs --help | grep -q "create-clanker-support" |
33 | 44 | - name: Publish |
34 | 45 | run: npm publish --access public |
35 | | - env: |
36 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
|
0 commit comments