Skip to content

fix(ci): npm trusted publishing + manual release runs - #7

Merged
hiOpenmart merged 2 commits into
mainfrom
fix/npm-trusted-publishing
May 19, 2026
Merged

hiOpenmart merged 2 commits into
mainfrom
fix/npm-trusted-publishing

Conversation

@hiOpenmart

@hiOpenmart hiOpenmart commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Two changes to release.yml.

1. Publish to npm via trusted publishing (OIDC)

The v0.1.2 release run built the .mcpb and created the GitHub Release fine, but npm publish failed:

npm error code EOTP
npm error This operation requires a one-time password from your authenticator.

The npm account enforces 2FA for writes, and the NPM_TOKEN granular token does not bypass the OTP prompt.

Fix — switch to npm trusted publishing (OIDC), the post-2025 recommended path with no long-lived token:

  • upgrade npm to >= 11.5.1 (required for OIDC publishing)
  • drop registry-url / NODE_AUTH_TOKEN; npm publish uses the id-token OIDC flow (provenance recorded automatically)

2. Manual release runs that auto-tag

Add a workflow_dispatch trigger with a bump input (patch / minor / major). A manual run from the Actions tab bumps the version with npm version (which also syncs manifest.json), commits, pushes the tag, then builds + releases — no need to run npm version locally.

The v* tag-push trigger still works; the version/tag are now resolved from package.json so both paths share the release steps.

Action needed before this works

Configure the package's trusted publisher on npmjs.com (openmart-mcp-server → Settings → Trusted Publisher → GitHub Actions):

  • Organization or user: OpenmartAI
  • Repository: openmart-mcp-server
  • Workflow filename: release.yml
  • Environment: (leave blank)

After that the NPM_TOKEN repository secret is unused and can be removed.

🤖 Generated with Claude Code

Haifeng Zhang and others added 2 commits May 19, 2026 17:16
The v0.1.2 release run failed at the publish step with npm EOTP: the
account enforces 2FA for writes and the NPM_TOKEN granular token does
not bypass the one-time-password prompt.

Switch release.yml to npm trusted publishing (OIDC), which is the
post-2025 recommended path and needs no token:
- upgrade npm to >= 11.5.1 (required for OIDC publishing)
- drop registry-url and NODE_AUTH_TOKEN; `npm publish` uses the
  id-token OIDC flow (provenance is recorded automatically)

Still needed: configure the package's trusted publisher on npmjs.com
for this repo + release.yml. The NPM_TOKEN secret can then be removed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add a workflow_dispatch trigger to release.yml with a bump-type input
(patch/minor/major). On a manual run the workflow bumps the version
with npm version (which also syncs manifest.json), commits, pushes the
tag, then builds + releases — so a release can be cut from the Actions
tab without running npm version locally.

The tag-push trigger still works; version/tag are now resolved from
package.json so both paths share the same release steps.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hiOpenmart hiOpenmart changed the title fix(ci): publish to npm via trusted publishing (OIDC) fix(ci): npm trusted publishing + manual release runs May 19, 2026
@hiOpenmart
hiOpenmart merged commit fb21158 into main May 19, 2026
1 check passed
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.

1 participant