|
| 1 | +# Release Workflow |
| 2 | + |
| 3 | +Execute the full release workflow for this library. Follow each step in order. Do not skip steps. |
| 4 | + |
| 5 | +## Step 1: Validate State |
| 6 | + |
| 7 | +1. Confirm the current branch matches the pattern `release/vX.Y.Z`. If not, stop and warn the user. |
| 8 | +2. Read `package.json` and extract the `"version"` field. This is `VERSION` (e.g. `2.6.0`). |
| 9 | +3. The tag to create is `v$VERSION` (e.g. `v2.6.0`). |
| 10 | +4. Confirm the tag `v$VERSION` does not already exist (`git tag -l v$VERSION`). If it does, stop and warn. |
| 11 | +5. Find the previous tag: `git tag --sort=-creatordate | head -1`. This is `PREV_TAG`. |
| 12 | +6. Tell the user the version, the tag to be created, and the previous tag being diffed against. |
| 13 | + |
| 14 | +## Step 2: Create PR to main |
| 15 | + |
| 16 | +Create a PR from the current branch into `main`: |
| 17 | + |
| 18 | +``` |
| 19 | +gh pr create --base main --title "Release v$VERSION" --body "Release v$VERSION" |
| 20 | +``` |
| 21 | + |
| 22 | +Print the PR URL, then **stop and ask the user to merge the PR on GitHub and come back**. Do not proceed until the user explicitly confirms the PR has been merged. |
| 23 | + |
| 24 | +## Step 3: Checkout main |
| 25 | + |
| 26 | +After the user confirms the merge: |
| 27 | + |
| 28 | +``` |
| 29 | +git checkout main |
| 30 | +git pull origin main |
| 31 | +``` |
| 32 | + |
| 33 | +## Step 4: Create and push annotated tag |
| 34 | + |
| 35 | +``` |
| 36 | +git tag -a v$VERSION -m "tag v$VERSION" |
| 37 | +git push origin v$VERSION |
| 38 | +``` |
| 39 | + |
| 40 | +## Step 5: Create draft GitHub release |
| 41 | + |
| 42 | +Analyze changes between `PREV_TAG` and `v$VERSION` to write release notes: |
| 43 | + |
| 44 | +``` |
| 45 | +git log $PREV_TAG..v$VERSION --oneline |
| 46 | +``` |
| 47 | + |
| 48 | +Also inspect merged PRs and their authors for additional context. |
| 49 | + |
| 50 | +### Release notes format |
| 51 | + |
| 52 | +- Use **only** these H3 category headers (include only categories that have entries): |
| 53 | + - `### ✨ Features` — new features, new props, new capabilities |
| 54 | + - `### ⚠️ Changes` — breaking or behavioural changes, deprecations |
| 55 | + - `### 📈 Improvements` — enhancements to existing functionality, better defaults |
| 56 | + - `### 🐛 Fixes` — bug fixes |
| 57 | + - `### ⚙️ Dev Setup Modifications` — tooling, deps, CI, dev config changes |
| 58 | +- Each entry is a bullet point, written as a brief sentence. |
| 59 | +- Do NOT include PR/issue numbers for changes by `troberts-28`. Only reference PR/issue numbers inline as `(#XX)` for changes contributed by someone other than `troberts-28`. |
| 60 | +- If a change was contributed by someone other than `troberts-28`, append `@username` to that bullet. |
| 61 | +- If there were external contributors, add a closing line: `Thanks @user1 and @user2 for your contributions 👏` (adjust for singular/plural). |
| 62 | +- If the release has **only** dev/tooling changes (nothing user-facing), prepend: `N.B. This release doesn't introduce any changes to the published package.` |
| 63 | +- Do NOT include merge commits, version bumps, or branch-merge housekeeping. |
| 64 | +- Keep descriptions simple and brief. |
| 65 | + |
| 66 | +### Create the release |
| 67 | + |
| 68 | +Show the drafted release notes to the user and ask for confirmation before creating. Once confirmed: |
| 69 | + |
| 70 | +``` |
| 71 | +gh release create v$VERSION --draft --title "Release v$VERSION" --notes "<release_notes>" |
| 72 | +``` |
| 73 | + |
| 74 | +## Step 6: Merge main into develop |
| 75 | + |
| 76 | +``` |
| 77 | +git checkout develop |
| 78 | +git pull origin develop |
| 79 | +git merge main --no-ff -m "Merge branch 'main' into develop" |
| 80 | +git push origin develop |
| 81 | +``` |
| 82 | + |
| 83 | +Tell the user the release is complete and summarise what was done. |
0 commit comments