Repository navigation
ci: run the release through the shared changesets-release workflow - #115
Merged
Merged
Conversation
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.
Intent
Move form-builder's release onto the shared
changesets-release.yml@v1workflow ofwhatsaaaa/template, after a pack dry run shows the packages pack the same through it, and only if it covers everything today's release does. This is step (5) of the move to the shared template, after the tool bumps,flat/recommended, the shared config packages and the shared CI. It changes no source, adds no changeset and triggers no release.What changed
.github/workflows/release.ymlis now a caller ofwhatsaaaa/template/.github/workflows/changesets-release.yml@v1, in the shape the template's Copierrelease.ymlrenders (the same file design-system has used since whatsaaaa/design-system#57). The file keeps its name, which npm's trusted publisher checks.select-mode,version,pack,publishjobs,changesets/action/*@v2release / select-mode,release / version,release / pack,release / publish,changesets/action/*pinned tov2.1.2(the commit@v2resolves to today)pnpm install --frozen-lockfilecache: false, the same stepspnpm build, thenchangesets/action/packchangesets/action/packalone: each package'sprepack(tsdown) builds it, as it already did a second time today. The dry run below shows the tarballs are byte-identicalpublishin thenpmenvironment,id-token: write,contents: writeenvironment: npm(a calling job cannot set one) and asks for the same permissions, which the caller grantsEvery requirement the release has today, and where the shared workflow covers it:
changeset packandchangeset publishread the publish plan for the whole workspace; the dry run packs all five published packages through it.rctag. The changesets CLI reads.changeset/pre.jsonitself, inchangeset versionand whenselect-modebuilds the publish plan (each release'stagis the pre state'src); the workflow passes nothing for it, today or through the shared one.npmenvironment. npm validates the calling workflow's file name (release.yml, kept) and the job's environment (npm, declared on the shared publish job).id-token: writeis granted by both the caller and the shared publish job, as npm requires for a reusable workflow. Provenance comes with trusted publishing through the samechangesets/action/publishas today. The trusted publisher on npm and thenpmenvironment with its required reviewer stay as they are.ci.ymlonchangeset-release/mainthroughworkflow_dispatch, whichci.ymlalready has. Every check themainruleset requires is a job inci.yml, with nopull_request-only condition, so all of them report on that pull request's head commit. Today's release does not do this; it is the one behaviour the shared workflow adds, and the reason the caller grantsactions: write. On design-system's open Version Packages pull request (Version Packages design-system#65) the dispatched run reportsci / checkandci / browseron its head commit, marked required.No gap, so nothing is left for a template follow-up.
Pack dry run
Same checkout, same lockfile, both flows run through
changeset pack(whatchangesets/action/packruns) with a publish plan naming all five published packages at their current versions and therctag, since all of them are already on npm and an unplanned pack finds nothing to pack:pnpm install --frozen-lockfile,pnpm build,changeset pack --from-publish-plan <plan> --out-dir <tmp>/today;dist/removed, thenchangeset pack --from-publish-plan <plan> --out-dir <tmp>/shared(onlyprepackbuilds).@whatsaaaa/form-builder-schema@1.0.0-rc.3LICENSE,README.md,package.json,definition.schema.json,dist/index.{js,js.map,d.ts},dist/json-schema.{js,js.map,d.ts},dist/json-layout-DDxMYHJU.{js,js.map},dist/form-rule-def-DFINV_M0.d.ts6e07ccbee6c7e5ad…both@whatsaaaa/form-builder-affects@0.2.2-rc.0LICENSE,README.md,package.json,definition.schema.json,dist/index.{js,js.map,d.ts}442bf74d3847cf27…both@whatsaaaa/form-builder-fills@0.1.0-rc.0LICENSE,README.md,package.json,definition.schema.json,dist/index.{js,js.map,d.ts}a375125491ee9a23…both@whatsaaaa/form-builder-vue@1.0.0-rc.3LICENSE,README.md,package.json,dist/index.{js,js.map,d.ts}5924797b29295f9c…both@whatsaaaa/form-builder-react@1.0.0-rc.3LICENSE,README.md,package.json,dist/index.{js,js.map,d.ts}264b8725dc1a4e63…bothThe two sets of tarballs are byte-identical (same sha256, and
diff -rof the extracted trees finds nothing), so the packedpackage.jsonfiles are the same too:exportsfrompublishConfig.exports(dist),files,publishConfig.access: public, the peers and versions. Thepublish-plan.jsoneach run wrote carries the same integrity hashes. Run locally with Node 26 and pnpm 12.18.0 (CI uses Node 24 for both flows alike). No package needs another'sdistto pack, since inside the workspace theirexportspoint atsrc.Checks
tests/template/check-callers.pyatv1: "2 call(s) of the reusable workflows match them" (inputs, permissions, the dispatchedci.ymland itsworkflow_dispatchtrigger).pnpm format:check,pnpm lintwith a clean tree after it.After merging
No changeset is pending and every package version is already on npm, so the push to
mainrunsrelease / select-modeonly and publishes nothing. No package has published throughchangesets-release.yml@v1yet (design-system has versioned through it, not yet published), so form-builder's next publish, or design-system's first, is the live proof of trusted publishing from the shared workflow. If it failed, the publish job would stop at the OIDC exchange with nothing published, after thenpmenvironment's reviewer approved it, and reverting this PR restores the old release.The release jobs' check names change from
select-mode,version,pack,publishtorelease / …; none of them is required by themainruleset.