diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71d9592..2519773 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,11 @@ name: Release # Publishes all public packages to npm with provenance. # Trigger: push a version tag (v0.1.0) or run manually from the Actions tab. -# Requires the NPM_TOKEN repo secret (npm automation token with publish -# rights on the @autter scope). +# +# Authenticates with npm trusted publishing (OIDC), not a stored token: each +# package's settings on npmjs.com trust this workflow (Autter-dev/autter-runtime, +# release.yml). A new public package needs its own trusted publisher before its +# first release from here, and renaming this file means recreating them all. on: push: @@ -12,33 +15,25 @@ on: permissions: contents: read - id-token: write # npm provenance + id-token: write # npm trusted publishing and provenance jobs: publish: - # npm provenance currently accepts GitHub-hosted runners only. + # npm trusted publishing accepts GitHub-hosted runners only. runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - registry-url: https://registry.npmjs.org - # npm answers a publish it refuses with E404, so name the account the - # token signs in as before building: an expired token, or one from an - # account without write access to @autter, fails here with a clear error. - - name: Check the npm token - run: | - user=$(npm whoami) || { echo "::error::NPM_TOKEN is invalid or expired (npm whoami failed)"; exit 1; } - echo "NPM_TOKEN signs in as npm user: $user" - if ! npm access list collaborators @autter/runtime-browser 2>/dev/null | grep -q "$user"; then - echo "::warning::npm user $user is not a collaborator on @autter/runtime-browser; publishes will fail with E404" - fi - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm install - run: npm run build - run: npm run size -w @autter/runtime-browser + # Trusted publishing needs npm 11.5.1 or newer; Node 22 ships npm 10. + - name: Update npm + run: | + npm install -g npm@11 + npm --version - name: Publish packages (skips versions that already exist) run: | # runtime-core is private (bundled into node + edge) and never published. @@ -54,5 +49,3 @@ jobs: npm publish -w "$name" fi done - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 3940491..0ee9489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +## [1.20.1] - 2026-11-15 + +Packages: `runtime-browser` 1.8.2, `runtime-node` 1.16.1, `runtime-edge` 1.4.3, `runtime-next` 1.11.1, `runtime-cli` 1.4.1, `otlp-ingester` 1.18.1. No code changes from 1.20.0. + +- Releases are published to npm with trusted publishing instead of a stored npm token, so a publish can no longer fail because a token expired. Every package is republished once so npm records the new publisher for each. + ## [1.20.0] - 2026-11-15 Packages: `runtime-node` 1.16.0, `runtime-next` 1.11.0 (now requires `runtime-node` 1.16.0 or later), `runtime-cli` 1.4.0, `otlp-ingester` 1.18.0, and the Python adapter (`adapters/python`, copied, not published). `runtime-core` (private, bundled into the others) changes too. `runtime-browser` and `runtime-edge` do not: their built `dist` is byte-identical to 1.19.0 (only `runtime-browser`'s README wording changed). diff --git a/README.md b/README.md index 8d3bc2f..375b5d0 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ npm install @autter/runtime-edge # Cloudflare Workers, Vercel Edge, Deno, B | Package | Version | Use it for | | --- | --- | --- | -| `@autter/runtime-browser` | 1.8.1 | Browser errors + usage, coded-error duck typing, request-id capture | -| `@autter/runtime-node` | 1.16.0 | Node servers: OTel tracing, request summaries, coded errors, operations | -| `@autter/runtime-next` | 1.11.0 | Next.js: server + client + `/edge` for `middleware.ts` | -| `@autter/runtime-edge` | 1.4.2 | Fetch-only runtimes: request summaries and coded errors over `/v1/logs` | -| `@autter/otlp-ingester` | 1.18.0 | Self-hosted ingest — upgrade it **before** the SDKs | -| `@autter/runtime-cli` | 1.4.0 | Build time: debug ids + source map upload (CLI, Vite/Rollup, webpack, Next.js) | +| `@autter/runtime-browser` | 1.8.2 | Browser errors + usage, coded-error duck typing, request-id capture | +| `@autter/runtime-node` | 1.16.1 | Node servers: OTel tracing, request summaries, coded errors, operations | +| `@autter/runtime-next` | 1.11.1 | Next.js: server + client + `/edge` for `middleware.ts` | +| `@autter/runtime-edge` | 1.4.3 | Fetch-only runtimes: request summaries and coded errors over `/v1/logs` | +| `@autter/otlp-ingester` | 1.18.1 | Self-hosted ingest — upgrade it **before** the SDKs | +| `@autter/runtime-cli` | 1.4.1 | Build time: debug ids + source map upload (CLI, Vite/Rollup, webpack, Next.js) | Minimum versions per feature, SDK and ingester are in one table: [Version compatibility](docs/COMPATIBILITY.md#compatibility-table). Once diff --git a/docs/RELEASING.md b/docs/RELEASING.md index f235be3..8a4d350 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -4,10 +4,16 @@ 1. Create the **`autter` organization on npmjs.com** (Add Organization → name `autter`) — this owns the `@autter` scope. -2. Generate an **automation token**: npmjs.com → Access Tokens → - Generate New Token → *Automation* (bypasses 2FA for CI). -3. Add it to this repo as the `NPM_TOKEN` secret: - `gh secret set NPM_TOKEN -R Autter-dev/autter-runtime`. +2. For **each public package** (`runtime-browser`, `runtime-node`, + `runtime-edge`, `runtime-next`, `runtime-cli`, `otlp-ingester`), add a + trusted publisher: npmjs.com → the package → Settings → Trusted Publisher + → GitHub Actions, with organization `Autter-dev`, repository + `autter-runtime`, workflow `release.yml`, no environment, and + **Allow `npm publish`** ticked. A new trusted publisher must be used by a + publish within 2 days or npm drops it. +3. Once each package has published through it, set the package's + publishing access to *Require two-factor authentication and disallow + bypass 2fa tokens*. No npm token is stored in this repo. ## Publishing a release @@ -21,7 +27,8 @@ The `Release` workflow builds everything, runs the browser size gate, and publishes each package whose version doesn't already exist on the registry -— re-running is safe. Packages publish with npm **provenance**, so the +— re-running is safe. It authenticates with npm trusted publishing (OIDC), so +there is no token to renew. Packages publish with npm **provenance**, so the version page shows it was built from this repo by CI. Manual fallback: Actions tab → Release → Run workflow. diff --git a/package-lock.json b/package-lock.json index 5f531a7..0c6207b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6718,7 +6718,7 @@ }, "packages/otlp-ingester": { "name": "@autter/otlp-ingester", - "version": "1.18.0", + "version": "1.18.1", "license": "MIT", "dependencies": { "@clickhouse/client": "^1.12.0", @@ -6744,7 +6744,7 @@ }, "packages/runtime-browser": { "name": "@autter/runtime-browser", - "version": "1.8.1", + "version": "1.8.2", "license": "MIT", "devDependencies": { "@size-limit/preset-small-lib": "^11.1.6", @@ -6755,7 +6755,7 @@ }, "packages/runtime-cli": { "name": "@autter/runtime-cli", - "version": "1.4.0", + "version": "1.4.1", "license": "MIT", "dependencies": { "@sveltejs/acorn-typescript": "^1.0.13", @@ -6807,7 +6807,7 @@ }, "packages/runtime-edge": { "name": "@autter/runtime-edge", - "version": "1.4.2", + "version": "1.4.3", "license": "MIT", "devDependencies": { "@autter/runtime-core": "0.0.0", @@ -6820,7 +6820,7 @@ }, "packages/runtime-next": { "name": "@autter/runtime-next", - "version": "1.11.0", + "version": "1.11.1", "license": "MIT", "dependencies": { "@autter/runtime-browser": "^1.8.0", @@ -6843,7 +6843,7 @@ }, "packages/runtime-node": { "name": "@autter/runtime-node", - "version": "1.16.0", + "version": "1.16.1", "license": "MIT", "dependencies": { "@opentelemetry/api": "~1.9.0", diff --git a/packages/otlp-ingester/package.json b/packages/otlp-ingester/package.json index 198dcbd..730af06 100644 --- a/packages/otlp-ingester/package.json +++ b/packages/otlp-ingester/package.json @@ -1,6 +1,6 @@ { "name": "@autter/otlp-ingester", - "version": "1.18.0", + "version": "1.18.1", "description": "Self-hostable OTLP + browser-error ingest service for Autter Runtime: normalises telemetry into a per-repo ClickHouse data model", "license": "MIT", "type": "module", diff --git a/packages/runtime-browser/package.json b/packages/runtime-browser/package.json index 8114f06..4f288f2 100644 --- a/packages/runtime-browser/package.json +++ b/packages/runtime-browser/package.json @@ -1,6 +1,6 @@ { "name": "@autter/runtime-browser", - "version": "1.8.1", + "version": "1.8.2", "description": "Tiny, dependency-free browser error and usage tracker for Autter Runtime (<10 KB gzipped)", "license": "MIT", "type": "module", diff --git a/packages/runtime-cli/package.json b/packages/runtime-cli/package.json index cf40240..57638bc 100644 --- a/packages/runtime-cli/package.json +++ b/packages/runtime-cli/package.json @@ -1,6 +1,6 @@ { "name": "@autter/runtime-cli", - "version": "1.4.0", + "version": "1.4.1", "description": "Readable stack traces for Autter Runtime: inject debug ids into JS bundles and upload their source maps (CLI, Vite/Rollup, webpack and Next.js plugins)", "license": "MIT", "type": "module", diff --git a/packages/runtime-edge/package.json b/packages/runtime-edge/package.json index 45afb76..dccb43a 100644 --- a/packages/runtime-edge/package.json +++ b/packages/runtime-edge/package.json @@ -1,6 +1,6 @@ { "name": "@autter/runtime-edge", - "version": "1.4.2", + "version": "1.4.3", "description": "Autter Runtime for edge runtimes (Cloudflare Workers, Vercel Edge, Deno, Bun): request wide events and coded errors over fetch, zero dependencies", "license": "MIT", "type": "module", diff --git a/packages/runtime-next/package.json b/packages/runtime-next/package.json index fed2921..37f798b 100644 --- a/packages/runtime-next/package.json +++ b/packages/runtime-next/package.json @@ -1,6 +1,6 @@ { "name": "@autter/runtime-next", - "version": "1.11.0", + "version": "1.11.1", "description": "One-command Autter Runtime for Next.js: server OTel, request wide events, coded errors, browser tracker, relay route, edge middleware and React error boundary", "license": "MIT", "type": "module", diff --git a/packages/runtime-node/package.json b/packages/runtime-node/package.json index 08a18b2..aa6cb3d 100644 --- a/packages/runtime-node/package.json +++ b/packages/runtime-node/package.json @@ -1,6 +1,6 @@ { "name": "@autter/runtime-node", - "version": "1.16.0", + "version": "1.16.1", "description": "Autter Runtime for Node.js: request wide events, coded errors, operation logging, same-origin browser relay and a curated OpenTelemetry server tracker", "license": "MIT", "type": "module",