From 81d508c91f802d2003e71593b2a2335fcf4bde90 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Thu, 20 Aug 2026 18:43:40 +0800 Subject: [PATCH] release: npm trusted publishing (OIDC, no tokens) --- .github/workflows/release.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9dd23f1..394d1c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,28 +1,33 @@ name: release +# Release: tag v* to publish `interscript-ts` to npm via TRUSTED PUBLISHING +# (OIDC — no long-lived tokens). +# +# One-time manual setup: +# 1. Manually publish ONCE (npm publish --access public) +# 2. On npmjs.com: Settings → Trusted publishing → GitHub Actions → +# org `interscript`, repo `interscript-ts`, workflow `release.yml` + on: push: - tags: - - "v*" + tags: ['v*'] permissions: + id-token: write contents: read - id-token: write # required for npm provenance jobs: - publish: + release: runs-on: ubuntu-latest - environment: release steps: - - uses: actions/checkout@v7 - - uses: actions/setup-node@v7 + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 with: - node-version: "22" - cache: npm + node-version: '24' registry-url: https://registry.npmjs.org + - run: npm ci - run: npm run build - run: npm test - - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.INTERSCRIPT_NPM_TOKEN }} + - run: npm publish --access public