Skip to content

npm-trusted-publishing - #880

Merged
general-kroll-4-life merged 1 commit into
mainfrom
chore/npm-trusted-publishing
Oct 31, 2026
Merged

general-kroll-4-life merged 1 commit into
mainfrom
chore/npm-trusted-publishing

Conversation

@jeffreyaven

Copy link
Copy Markdown
Member

Description

Moves the npm wrapper publish (release process step 8a) from a local npm login + OTP publish into the mcp-packaging workflow, authenticated with GitHub Actions OIDC via npm trusted publishing. npm attaches a provenance attestation automatically. PyPI (8b) stays manual and is out of scope.

Changes:

  • packaging/mcpb/Makefile: new npm-publish target on the same contract as the other <vector>-publish targets (idempotent via a registry existence check, prints the resulting coordinate). It publishes the same npm/ directory that npm-pack packs, so the artefact is identical: package.json, README.md, bin/stackql-mcp.js, platforms.json. npm-pack is relabelled as the local fallback.
  • .github/workflows/mcp-packaging.yml: new npm-publish job next to cargo-publish / dotnet-publish / go-publish, same gate (is_publish == 'true') and needs: [version, sdk], job-scoped id-token: write. Top-level permissions stays contents: read. No NODE_AUTH_TOKEN / NPM_TOKEN anywhere. Node 24.22.1 ships npm 11.x (>= 11.5.1 OIDC minimum).
  • .github/workflows/mcp-registry-publish.yml: comment and input description text only.
  • packaging/mcpb/README.md, docs/stackql_release_process.md: npm is published by CI; manual commands relabelled as the fallback; step 10 now instructs running make npm-manifest locally for the plugin stamp (the runner's stamp is discarded).

Design notes for debate once:

  • No new repository or organisation secrets. The trusted publisher configuration on npmjs.com is the credential. It must be created immediately before dispatching the next release (owner stackql, repo stackql, workflow mcp-packaging.yml, environment blank, npm publish ticked). A fresh configuration expires if no publish succeeds within 2 days, and cannot be edited after creation.
  • packaging/mcpb/npm/package.json, bin/stackql-mcp.js and the renderer scripts are untouched. The PyPI, cargo, go, dotnet, OCI and registry jobs are untouched.
  • Nothing has been published or dispatched from this PR. The first OIDC publish happens on the next real release; see the first-release verification steps in the release process doc (npm view ... dist.attestations.url, npm pack --dry-run file list comparison against the previous manual publish, make check-published).

Type of change

  • Bug fix (non-breaking change to fix a bug).
  • Feature (non-breaking change to add functionality).
  • Breaking change.
  • Other (eg: documentation change). Please explain. CI / release-process change: adds a publish job and make target; no runtime code changes.

Issues referenced.

None.

Evidence

  • python -c "import yaml; ..." parsing both edited workflows: passed. The new job resolves to needs: ['version', 'sdk'], permissions: {contents: read, id-token: write}, setup-node with node-version: 24.22.1, registry-url: https://registry.npmjs.org.
  • make -n npm-publish VERSION=0.0.0 (from packaging/mcpb, dry run, executes nothing): passed; recipe chain is check-version -> openai-plugin-manifest -> npm-manifest -> existence guard -> npm publish --dry-run --access public && npm publish --access public.
  • npm/package.json has no lifecycle scripts and files + implicit package.json yield exactly the four expected entries, so the job needs no npm ci.
  • mcp-packaging PR validation (triggered by this PR's packaging/** and workflow path changes) exercises the test / bundle / sdk jobs; the npm-publish job is correctly skipped on PRs because is_publish != 'true'.
  • Not run: npm publish, workflow dispatch (deliberately, per the work order; first OIDC publish is on the next real release).

Checklist:

  • A full round of testing has been completed, and there are no test failures as a result of these changes.
  • The changes are covered with functional and/or integration robot testing.
  • The changes work on all supported platforms.
  • Unit tests pass locally, as per the developer guide.
  • Robot tests pass locally, as per the developer guide.
  • Linter passes locally, as per the developer guide.

Variations

No Go code, robot tests, or unit tests are affected (CI workflow, Makefile and docs only), so the unit / robot / lint checklist items are not applicable. The relevant validation is the mcp-packaging PR check on this branch plus the dry-run evidence above; the publish path itself can only be validated on the first dispatched release, with the verification steps documented in section 8a of the release process.

Tech Debt

None. The manual npm publish path is retained as a documented fallback, not as a parallel process.

Publish @stackql/mcp-server from the mcp-packaging workflow via npm
trusted publishing (GitHub Actions OIDC, provenance attached) instead of
a local npm login + OTP publish. Adds the idempotent make npm-publish
target (publishes the same npm/ directory that npm-pack packs) and the
npm-publish job gated like the other sdk publish jobs. PyPI stays manual.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@general-kroll-4-life
general-kroll-4-life merged commit 70c09ea into main Oct 31, 2026
50 checks passed
@general-kroll-4-life
general-kroll-4-life deleted the chore/npm-trusted-publishing branch October 31, 2026 07:25
@jeffreyaven jeffreyaven mentioned this pull request Oct 31, 2026
1 of 10 tasks
general-kroll-4-life pushed a commit that referenced this pull request Oct 31, 2026
Publish @stackql/mcp-server from the mcp-packaging workflow via npm
trusted publishing (GitHub Actions OIDC, provenance attached) instead of
a local npm login + OTP publish. Adds the idempotent make npm-publish
target (publishes the same npm/ directory that npm-pack packs) and the
npm-publish job gated like the other sdk publish jobs. PyPI stays manual.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants