|
| 1 | +--- |
| 2 | +description: "Create a release branch, bump version, and update CHANGELOG. Usage: /release patch|minor|major" |
| 3 | +allowed-tools: Bash, Read, Edit, Write |
| 4 | +--- |
| 5 | + |
| 6 | +Read the current version from `gradle.properties` (the `VERSION_NAME` property). |
| 7 | + |
| 8 | +The bump type is: $ARGUMENTS |
| 9 | + |
| 10 | +Compute the new version by incrementing the appropriate component of the current version: |
| 11 | +- `patch` — increment the third number, keep major and minor (e.g. 1.7.0 → 1.7.1) |
| 12 | +- `minor` — increment the second number, reset patch to 0 (e.g. 1.7.0 → 1.8.0) |
| 13 | +- `major` — increment the first number, reset minor and patch to 0 (e.g. 1.7.0 → 2.0.0) |
| 14 | + |
| 15 | +Then perform these steps in order: |
| 16 | + |
| 17 | +1. Run `git checkout -b release/NEW_VERSION` |
| 18 | +2. Replace `OLD_VERSION` with `NEW_VERSION` in all of the following files: |
| 19 | + - `gradle.properties` — the `VERSION_NAME` property |
| 20 | + - `README.md` — 3 places: Maven `<version>`, Gradle `implementation '…'`, and LiveObjects `runtimeOnly("…")` |
| 21 | + - `CONTRIBUTING.md` — the `implementation files('libs/ably-android-OLD_VERSION.aar')` line |
| 22 | + - `lib/src/test/java/io/ably/lib/test/realtime/RealtimeHttpHeaderTest.java` — the hardcoded `"ably-java/OLD_VERSION"` string in the agent header assertion |
| 23 | + Commit all five files together with message: `chore: bump version to NEW_VERSION` |
| 24 | +3. Fetch merged PRs since the last release tag using: |
| 25 | + ``` |
| 26 | + gh pr list --state merged --base main --json number,title,mergedAt --limit 200 |
| 27 | + ``` |
| 28 | + Then get the date of the last release tag with: |
| 29 | + ``` |
| 30 | + git log vOLD_VERSION --format="%aI" -1 |
| 31 | + ``` |
| 32 | + Filter the PRs to only those merged after that tag date. Format each as: |
| 33 | + ``` |
| 34 | + - Short, one sentence summary from PR title and description [#NUMBER](https://github.com/ably/ably-java/pull/NUMBER) |
| 35 | + ``` |
| 36 | + If the tag doesn't exist or there are no merged PRs, use a single `-` placeholder bullet instead. |
| 37 | + |
| 38 | +4. In `CHANGELOG.md`, insert the following block immediately after the `# Change Log` heading (and its trailing blank line), before the first existing `## [` version entry: |
| 39 | + |
| 40 | +``` |
| 41 | +## [NEW_VERSION](https://github.com/ably/ably-java/tree/vNEW_VERSION) |
| 42 | +
|
| 43 | +[Full Changelog](https://github.com/ably/ably-java/compare/vOLD_VERSION...vNEW_VERSION) |
| 44 | +
|
| 45 | +### What's Changed |
| 46 | +
|
| 47 | +BULLETS_FROM_STEP_3 |
| 48 | +
|
| 49 | +``` |
| 50 | + |
| 51 | +5. Commit `CHANGELOG.md` with message: `docs: update CHANGELOG for NEW_VERSION release` |
| 52 | + |
| 53 | +After completing all steps, show the user a summary of what was done. If PRs were found, list them. If the placeholder `-` was used instead, remind them to fill in the `### What's Changed` bullet points in `CHANGELOG.md` before merging. |
0 commit comments