Repository navigation
ci: release through the Changesets Version Packages PR - #81
Merged
Merged
Conversation
Publish only ran `npm publish` when someone hand-edited the version in package.json, so changesets piled up unconsumed (40 of them) and merged work (#77, #78, #80) never shipped: every run skipped because 5.3.1 was already on npm. publish.yaml now follows the official Changesets trusted-publishing layout (changesets/action v2, split jobs): - select-mode: pending changesets -> version, unpublished version -> publish - version: opens/updates "chore(release): version packages" with SDK_SYNC_PAT so CI runs on it; changelog-github links PRs and authors - pack: type-check, test, build, pack the exact commit being released - publish: the only job with id-token: write; publishes the packed tarball via npm OIDC, tags vX.Y.Z and creates the GitHub release Actions are pinned by SHA, permissions default to none, checkout does not persist credentials, and release jobs restore no cache. api-sync now writes .changeset/api-sync-<spec sha>.md instead of bumping package.json, so syncs release through the same PR. The name is derived from the delivered spec, keeping the determinism proof byte-identical. Also: @changesets/cli 2.29.6 -> 3.0.3 (required by action v2), drop the 37 changesets that already shipped in <= 5.3.1 (consuming them would have cut a bogus 6.0.0), backfill CHANGELOG links for 4.1.0-5.3.1, document the flow.
- setup-bun no-cache: the publish job (id-token: write) restored and ran a cached bun binary; package-manager-cache only covered setup-node - require SDK_SYNC_PAT instead of silently falling back to GITHUB_TOKEN, which would open the Version Packages PR with no CI; a missing PAT now fails and pages via pipeline-alert.yml - drop the version step's GITHUB_TOKEN env: the action overrides it - add the non-blocking Changeset Status PR comment, since a PR merged without a changeset silently releases nothing - rename scripts/api-sync/version.ts to changeset.ts (it no longer versions) - document the half-failed release recovery and the CLI's Node requirement
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#77 (EUR), #78 (wallet self-custody) and #80 (GBP) are merged but were never published.
publish.yamlonly published when someone hand-editedversioninpackage.json, and nothing ever ranchangeset version. So 40 changesets piled up, and everyPublishrun skipped because 5.3.1 was already on npm.What changes
publish.yamlnow follows the official Changesets trusted-publishing layout (changesets/actionv2). This is the same model Clerk uses: a bot opens a "Version packages" PR and a human merges it to release.select-modemainversion; version not on npm →publishcontents: readversionversionchore(release): version packageswithSDK_SYNC_PAT, so CI runs on it.@changesets/changelog-githublinks PRs and authorscontents/pull-requests: writepackpublishcontents: readpublishpackvX.Y.Z, creates the GitHub releasecontents: write, only job withid-token: writeHardening:
permissions: {}by default, set per job.persist-credentials: falseon checkout.setup-bunno-cache,package-manager-cache: false).SDK_SYNC_PATnow fails the run and pages Slack, instead of falling back toGITHUB_TOKENand opening a Version PR with no CI.Kept on purpose:
publish.yaml, because npm's trusted publisher is bound to it.name: Publish, becausepipeline-alert.ymlmatches on it.registry-urlwith noNODE_AUTH_TOKEN.Also:
.changeset/api-sync-<spec sha>.mdinstead of bumpingpackage.json. Syncs still auto-merge, but now release through the same Version PR. The file name comes from the delivered spec, so the determinism proof stays byte-identical. I checked this end to end with a modified spec: two runs gave identical output,package.jsonwas untouched, and the committed snapshot is a no-op.@changesets/cli2.29.6 → 3.0.3, which action v2 requires.v5.3.1or earlier, and they are notes only, not code. Consuming them would have produced a bogus 6.0.0, because 4 of them aremajor. The 3 unreleased ones (fix: add EUR currency support #77, feat(wallets): add self-custody support to blockchain wallets #78, feat: add GBP currency support #80) are kept.CHANGELOG.mdnow links the GitHub releases for 4.1.0–5.3.1.CLAUDE.md(Releasing) and.changeset/README.md, including a runbook for a release that half-fails.Acceptance plan (none of this has run on GitHub yet)
Everything so far was verified locally:
changeset status,version,publish-planandpackactionlintsync:checkandcontract-checkWhat only real runs can confirm:
Publishpicksversionand openschore(release): version packages. That PR should be authored by the PAT owner, showMainCI checks, setpackage.jsonto 5.4.0, and add three CHANGELOG entries linking feat(wallets): add self-custody support to blockchain wallets #78, feat: add GBP currency support #80 and fix: add EUR currency support #77 (previewed locally). If the CI checks are missing, the token path is wrong.pack→publish→ npm 5.4.0, tagv5.4.0and a GitHub release. Ifpublishfails with E404 or ENEEDAUTH, suspect the npm trusted-publisher binding or the npm version. A failure after npm succeeds is covered by the runbook.Notes:
@changesets/cliv3, which needs Node ≥ 22.11. Bun ignoresengines, and no test runs the CLI.Follow-ups (from the SRE review, deliberately not done here)
gh pr merge --automerges instantly, becausemainhas no required checks. This predates this PR.environment:approval gate onpublish. It needs repo settings plus a matching npm trusted-publisher config.secrets: inherittoday.