Skip to content

ci: stage v2 npm releases under the v2-legacy dist-tag - #1034

Merged
taylanpince merged 4 commits into
v2from
ci/v2-staged-npm-publishing
Oct 14, 2026
Merged

taylanpince merged 4 commits into
v2from
ci/v2-staged-npm-publishing

Conversation

@taylanpince

Copy link
Copy Markdown
Contributor

Summary

v2 releases were published with the default latest dist-tag, so 2.3.47 (Oct 2) moved latest off v3 for every package name shared with master (api, builder, guard, indexer, marketplace, metadata, relayer, abi). npm i @0xsequence/indexer currently installs v2.

This ports the staged publishing flow from #1033 to v2:

  • Merging changesets into v2 keeps a changesets: Release / Deploy (v2) PR up to date; versioning runs pnpm changeset:version (embedded version constant + network names doc).
  • Merging that PR stages every unpublished package under v2-legacy via OIDC trusted publishing; a maintainer approves with 2FA.
  • Same workflow file name as master (npm-release-trigger.yml), so one stage-only trusted publisher per package covers both branches.
  • Release gates: build (includes typecheck), lint, release script tests. The per-package matrix in tests.yml already runs on every push to v2.
  • Same token hardening as ci: stage npm releases via changesets and OIDC trusted publishing #1033 (GHSA-rxhc-j8g6-h4jp). pnpm dev replaces the preconstruct postinstall skipped by --ignore-scripts.
  • repository.directory on every package, .nvmrc, changelog-github, baseBranch: v2, changeset check on PRs into v2.

Prerequisites

Same as #1033 (release bot app + secrets, configure-npm-trust.sh from master, which already covers all v2 package names). Merge #1033 first.

Notes

  • Pre-existing: scripts/update-version.js writes @0xsequence/core's version into VERSION, which was stale at 2.3.28. Since linked only aligns versions of packages that are bumped, VERSION tracks core, not necessarily the release. Not changed here.

Test plan

  • pnpm test:release: 12 cases pass
  • Fresh --ignore-scripts install + pnpm dev + pnpm changeset:version succeeds (VERSION updated)
  • ci:release-gates passes (build, lint, release tests)
  • Staging rehearsal with a stub npm stage: nothing staged at current versions (all on npm); after a test bump, packages stage under --tag v2-legacy
  • actionlint on the new workflows
  • First live v2 release

🤖 Generated with Claude Code

https://claude.ai/code/session_014qDHk3SaPaDGpPTU1jjLpz

taylanpince and others added 3 commits October 14, 2026 11:06
v2 releases were published with the default `latest` tag, so 2.3.47 moved
`latest` off v3 for every package name shared with master (api, guard,
indexer, relayer, ...). Port master's staged publishing flow to v2:

- Release workflow (same file name as master, so one npm trusted publisher
  covers both) stages under `v2-legacy` via OIDC; a maintainer approves
  with 2FA. Versioning runs `pnpm changeset:version`.
- Release gates: typecheck, lint, build, release script tests.
- Add repository.directory to every package (required for provenance),
  .nvmrc, changelog-github, changeset check on PRs into v2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qDHk3SaPaDGpPTU1jjLpz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qDHk3SaPaDGpPTU1jjLpz
Same hardening as master (0xPolygon/pipelines fix for GHSA-rxhc-j8g6-h4jp):
check out without persisted credentials, install with --ignore-scripts, run
the release gates on release-PR merges before minting the scoped app token.
`pnpm dev` replaces the skipped preconstruct postinstall so
`changeset:version` can resolve workspace sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qDHk3SaPaDGpPTU1jjLpz
@taylanpince
taylanpince requested a review from a team October 14, 2026 09:55
@taylanpince
taylanpince requested a review from a team as a code owner October 14, 2026 09:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T10:01:56.383927Z 8861203 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8861203823

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const stagedPackages = []
for (const { releasePackage } of packagesToStage) {
const tarballPath = await packPackage(releasePackage, outputDirectory)
runChecked('npm', ['stage', 'publish', tarballPath, '--tag', distTag, '--access', 'public', '--provenance'], {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make partial staging retries idempotent

When staging multiple packages, a failure from any later npm stage publish aborts the custom publish command after earlier packages have already been staged. The pinned Changesets action then skips creating tags from the earlier New tag: lines—its documented partial-publish behavior—so a retry cannot recognize those packages: npm view does not expose pending stages, and npm states that a staged version occupies the same unique semver index and cannot be staged again. Consequently, one transient failure can wedge the entire release until maintainers manually reject the successful stages; persist each success independently or explicitly recognize already-staged versions on retry.

Useful? React with 👍 / 👎.

Port master's fixes: reject snapshot tags npm parses as semver ranges
(semver.validRange), and list every unpublished version (including ones
staged by an earlier, partially failed run) in the approval summary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qDHk3SaPaDGpPTU1jjLpz
@taylanpince
taylanpince merged commit a84307c into v2 Oct 14, 2026
25 of 26 checks passed
@taylanpince
taylanpince deleted the ci/v2-staged-npm-publishing branch October 14, 2026 15:12
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