|
| 1 | +--- |
| 2 | +name: cut-release |
| 3 | +description: Prepare and cut a Compose Unstyled release from this repository by finalizing CHANGELOG.md, bumping gradle/libs.versions.toml, committing the release, tagging it, pushing the tag, and confirming the GitHub Release workflow/draft release. Use when asked to prepare, cut, ship, publish, or tag a release for Compose Unstyled. |
| 4 | +--- |
| 5 | + |
| 6 | +# Cut Release |
| 7 | + |
| 8 | +Use this skill only in `/Users/alexstyl/projects/composeunstyled.com`. |
| 9 | + |
| 10 | +## Source of truth |
| 11 | + |
| 12 | +- Release automation: `.github/workflows/release.yml` |
| 13 | +- Version: `gradle/libs.versions.toml`, key `unstyled` |
| 14 | +- Release notes: `CHANGELOG.md` |
| 15 | +- Tags use plain SemVer, for example `2.0.1`, not `v2.0.1`. |
| 16 | +- Pushing a tag triggers the `Release` workflow, which runs Spotless, JVM tests, Android connected tests, publishes to Maven Central, and creates a draft GitHub Release from the matching changelog section. |
| 17 | + |
| 18 | +## Before Cutting |
| 19 | + |
| 20 | +1. Sync `main`: |
| 21 | + ```bash |
| 22 | + git switch main |
| 23 | + git pull --ff-only origin main |
| 24 | + git fetch --tags origin |
| 25 | + ``` |
| 26 | +2. Confirm all release PRs are merged. |
| 27 | +3. Inspect the current version and latest tag: |
| 28 | + ```bash |
| 29 | + rg '^unstyled = ' gradle/libs.versions.toml |
| 30 | + git tag --sort=-creatordate | head |
| 31 | + ``` |
| 32 | +4. Decide the next SemVer version from the user request and changelog contents. Ask if ambiguous. |
| 33 | + |
| 34 | +## Prepare Release Commit |
| 35 | + |
| 36 | +1. Move `CHANGELOG.md` Unreleased entries into a dated heading: |
| 37 | + ```markdown |
| 38 | + ## [x.y.z] - YYYY-MM-DD |
| 39 | + ``` |
| 40 | + Keep `## [Unreleased]` first. If no future entries exist, leave it empty. |
| 41 | +2. Update `gradle/libs.versions.toml`: |
| 42 | + ```toml |
| 43 | + unstyled = "x.y.z" |
| 44 | + ``` |
| 45 | +3. Validate the changelog section exactly matches the release workflow parser: |
| 46 | + - The heading must be `## [x.y.z] - YYYY-MM-DD`. |
| 47 | + - The tag must be `x.y.z`. |
| 48 | +4. Run required release checks before committing: |
| 49 | + ```bash |
| 50 | + ./gradlew jvmTest spotlessCheck |
| 51 | + ``` |
| 52 | + If Kotlin or UI behavior changed as part of release prep, also run the touched behavior tests required by `AGENTS.md`. |
| 53 | +5. Commit: |
| 54 | + ```bash |
| 55 | + git add CHANGELOG.md gradle/libs.versions.toml |
| 56 | + git commit -m "Release x.y.z" |
| 57 | + ``` |
| 58 | + |
| 59 | +## Tag And Push |
| 60 | + |
| 61 | +1. Create the tag on the release commit: |
| 62 | + ```bash |
| 63 | + git tag x.y.z |
| 64 | + ``` |
| 65 | +2. Push the branch first, then the tag: |
| 66 | + ```bash |
| 67 | + git push origin main |
| 68 | + git push origin x.y.z |
| 69 | + ``` |
| 70 | +3. If the workflow must be rerun manually, use the `Release` workflow with input `tag = x.y.z`. |
| 71 | + |
| 72 | +## Do Not |
| 73 | + |
| 74 | +- Do not invent release dates for future releases; use the current local date when cutting. |
| 75 | +- Do not use `v`-prefixed tags unless the repository changes its tag convention. |
| 76 | +- Do not push a release tag before `CHANGELOG.md` has a matching version heading. |
| 77 | +- Do not skip `jvmTest` and `spotlessCheck` for a release commit. |
0 commit comments