@@ -116,8 +116,14 @@ document the decision.
116116
117117## Cutting a release
118118
119- Releases are manually triggered to give maintainers full control
120- over timing.
119+ Releases happen in two phases:
120+
121+ - ** Phase 1 (open the Release PR)** is triggered manually by a
122+ maintainer via ` workflow_dispatch ` . This gives you control over
123+ _ when_ a release starts collecting changesets into a PR.
124+ - ** Phase 2 (tag + publish the GitHub Release)** is triggered
125+ automatically when the Release PR is merged. No second manual
126+ click is needed.
121127
1221281 . ** Prerequisites (one-time setup):**
123129 - The ` hypercerts-release-bot ` GitHub App must be installed on
@@ -127,24 +133,25 @@ over timing.
127133 repository secrets. This bot is used by the release workflow
128134 so that its automated "Version Packages" PR can bypass
129135 branch protection on ` main ` .
130- 2 . ** Run the workflow:**
136+ 2 . ** Run the workflow (phase 1 — open the Release PR) :**
131137 - Navigate to the
132138 [ Release workflow] ( https://github.com/hypercerts-org/ePDS/actions/workflows/release.yml ) .
133139 - Click "Run workflow" and select the ` main ` branch.
134- 3 . ** What happens:**
140+ 3 . ** What happens in phase 1 :**
135141 - The workflow checks out the repo using the release-bot app
136142 token, runs `pnpm build / format: check / lint / typecheck /
137143test` as a fail-fast gate, and then invokes
138144 ` changesets/action ` .
139145 - If there are pending changesets in ` .changeset/ ` , the action
140- opens (or updates) a ** "Release" PR** against ` main ` . This
141- PR applies the pending changesets: it bumps the root
142- ` ePDS ` version, consumes the changeset files, and updates
143- the root ` CHANGELOG.md ` . After ` changeset version ` has
144- written the new release section, ` scripts/changelog-audience-summary.mjs `
145- runs as part of ` pnpm version-packages ` to post-process the
146- section — it reads the ` **Affects:** ` line from each changeset
147- bullet, groups summaries by audience (End users → Client app
146+ opens (or updates) a ** "Release" PR** against ` main ` from the
147+ ` changeset-release/main ` branch. This PR applies the pending
148+ changesets: it bumps the root ` ePDS ` version, consumes the
149+ changeset files, and updates the root ` CHANGELOG.md ` . After
150+ ` changeset version ` has written the new release section,
151+ ` scripts/changelog-audience-summary.mjs ` runs as part of
152+ ` pnpm version-packages ` to post-process the section — it
153+ reads the ` **Affects:** ` line from each changeset bullet,
154+ groups summaries by audience (End users → Client app
148155 developers → Operators), prepends a "Who should read this
149156 release" block at the top of the section, and injects
150157 per-bullet HTML anchors so the summary links click through to
@@ -153,17 +160,25 @@ test` as a fail-fast gate, and then invokes
153160 workflow stops** — this is intentional so that a missed
154161 audience tag is surfaced immediately rather than becoming
155162 silently-missing release notes.
156- - Review and merge the Release PR. This is the checkpoint
157- where you verify the generated changelog and version number
158- before they become permanent.
159- - Re-run the Release workflow after the PR has been merged.
160- This time there are no pending changesets but the tag is
161- behind the ` package.json ` version, so the action runs
162- ` pnpm release ` (` changeset tag ` ), creates a ` v<version> `
163- git tag, and publishes a single GitHub Release whose body
164- is the matching section of ` CHANGELOG.md ` .
165- - If there are no pending changesets and the tag is up to
166- date, the workflow is a no-op.
163+ - If there are no pending changesets and the tag is up to date,
164+ phase 1 is a no-op.
165+ 4 . ** Phase 2 — automatic tag + GitHub Release:**
166+ - Review and merge the Release PR when you're happy with the
167+ generated changelog and version number. This is the checkpoint
168+ where you verify them before they become permanent.
169+ - When the Release PR (head branch ` changeset-release/main ` )
170+ merges into ` main ` , the workflow re-runs automatically via
171+ its ` pull_request: closed ` trigger. There are no pending
172+ changesets at this point but the git tag is behind the
173+ ` package.json ` version, so the action runs ` pnpm release `
174+ (` changeset tag ` ), creates a ` v<version> ` git tag, and
175+ publishes a single GitHub Release whose body is the matching
176+ section of ` CHANGELOG.md ` .
177+ - The auto-trigger only fires for PRs whose head ref is
178+ ` changeset-release/main ` . Merging any other PR into ` main `
179+ does ** not** start a release run.
180+ - You can re-trigger phase 2 manually via ` workflow_dispatch ` if
181+ the auto-run failed transiently.
167182
168183## Validating PRs
169184
0 commit comments