-
Notifications
You must be signed in to change notification settings - Fork 43
feat: add release automation command /release with version bump and CHANGELOG update logic
#1204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,53 @@ | ||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||
| description: "Create a release branch, bump version, and update CHANGELOG. Usage: /release patch|minor|major" | ||||||||||||||||||||||||||||||||||||
| allowed-tools: Bash, Read, Edit, Write | ||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| Read the current version from `gradle.properties` (the `VERSION_NAME` property). | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| The bump type is: $ARGUMENTS | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| Compute the new version by incrementing the appropriate component of the current version: | ||||||||||||||||||||||||||||||||||||
| - `patch` — increment the third number, keep major and minor (e.g. 1.7.0 → 1.7.1) | ||||||||||||||||||||||||||||||||||||
| - `minor` — increment the second number, reset patch to 0 (e.g. 1.7.0 → 1.8.0) | ||||||||||||||||||||||||||||||||||||
| - `major` — increment the first number, reset minor and patch to 0 (e.g. 1.7.0 → 2.0.0) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| Then perform these steps in order: | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| 1. Run `git checkout -b release/NEW_VERSION` | ||||||||||||||||||||||||||||||||||||
| 2. Replace `OLD_VERSION` with `NEW_VERSION` in all of the following files: | ||||||||||||||||||||||||||||||||||||
| - `gradle.properties` — the `VERSION_NAME` property | ||||||||||||||||||||||||||||||||||||
| - `README.md` — 3 places: Maven `<version>`, Gradle `implementation '…'`, and LiveObjects `runtimeOnly("…")` | ||||||||||||||||||||||||||||||||||||
| - `CONTRIBUTING.md` — the `implementation files('libs/ably-android-OLD_VERSION.aar')` line | ||||||||||||||||||||||||||||||||||||
| - `lib/src/test/java/io/ably/lib/test/realtime/RealtimeHttpHeaderTest.java` — the hardcoded `"ably-java/OLD_VERSION"` string in the agent header assertion | ||||||||||||||||||||||||||||||||||||
| Commit all five files together with message: `chore: bump version to NEW_VERSION` | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| Commit all five files together with message: `chore: bump version to NEW_VERSION` | |
| Commit all four files together with message: `chore: bump version to NEW_VERSION` |
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step 3 says to write a summary from the PR title and description, but the suggested gh pr list command only fetches number,title,mergedAt so the description/body isn't available. Either include body in the JSON fields (and/or switch to gh pr view per PR) or update the instruction to use only the title.
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instructions mention handling the case where tag vOLD_VERSION doesn't exist, but step 3 unconditionally runs git log vOLD_VERSION ..., which will error in that scenario. Add an explicit check/fallback (e.g., detect missing tag and skip date filtering / use the latest tag) so the command remains usable.
| Then get the date of the last release tag with: | |
| ``` | |
| git log vOLD_VERSION --format="%aI" -1 | |
| ``` | |
| Filter the PRs to only those merged after that tag date. Format each as: | |
| ``` | |
| - Short, one sentence summary from PR title and description [#NUMBER](https://github.com/ably/ably-java/pull/NUMBER) | |
| ``` | |
| If the tag doesn't exist or there are no merged PRs, use a single `-` placeholder bullet instead. | |
| Then get the date of the last release tag, only if the tag exists: | |
| ```bash | |
| if git rev-parse -q --verify "vOLD_VERSION^{tag}" >/dev/null; then | |
| git log vOLD_VERSION --format="%aI" -1 | |
| else | |
| # Tag doesn't exist; skip date filtering and consider all fetched PRs as candidates. | |
| echo "" | |
| fi |
If a tag date is available, filter the PRs to only those merged after that tag date. If no tag date is available (because the tag doesn't exist), either:
- treat all fetched PRs as candidates, or
- if there are no relevant PRs to include, fall back to the placeholder below.
Format each included PR as:
- Short, one sentence summary from PR title and description [#NUMBER](https://github.com/ably/ably-java/pull/NUMBER)
If, after applying this logic, there are no PRs to list, use a single - placeholder bullet instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add one more step, to validate changes made in accordance with original requirement and fix them if anything missing found
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -244,19 +244,13 @@ implementation files('libs/ably-android-1.7.0.aar') | |||||
|
|
||||||
| This library uses [semantic versioning](http://semver.org/). For each release, the following needs to be done: | ||||||
|
|
||||||
| 1. Create a branch for the release, named like `release/1.2.4` (where `1.2.4` is what you're releasing, being the new version) | ||||||
| 2. Replace all references of the current version number with the new version number (check the [README.md](./README.md) and [gradle.properties](./gradle.properties)) and commit the changes | ||||||
| 3. Run [`github_changelog_generator`](https://github.com/github-changelog-generator/github-changelog-generator) to automate the update of the [CHANGELOG](./CHANGELOG.md). This may require some manual intervention, both in terms of how the command is run and how the change log file is modified. Your mileage may vary: | ||||||
| - The command you will need to run will look something like this: `github_changelog_generator -u ably -p ably-java --since-tag v1.2.3 --output delta.md --token $GITHUB_TOKEN_WITH_REPO_ACCESS`. Generate token [here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token). | ||||||
| - Using the command above, `--output delta.md` writes changes made after `--since-tag` to a new file. | ||||||
| - The contents of that new file (`delta.md`) then need to be manually inserted at the top of the `CHANGELOG.md`, changing the "Unreleased" heading and linking with the current version numbers. | ||||||
| - Also ensure that the "Full Changelog" link points to the new version tag instead of the `HEAD`. | ||||||
| 4. Commit [CHANGELOG](./CHANGELOG.md) | ||||||
| 5. Make a PR against `main` | ||||||
| 6. Once the PR is approved, merge it into `main` | ||||||
| 7. Create the release and the release tag on Github including populating the release notes | ||||||
| 8. Use the [GitHub action](https://github.com/ably/ably-java/actions/workflows/release.yaml) to publish the release. Run the workflow on the latest release tag. | ||||||
| 9. Create the entry on the [Ably Changelog](https://changelog.ably.com/) (via [headwayapp](https://headwayapp.co/)) | ||||||
| 1. Run `/release patch|minor|major` in Claude Code — this creates the release branch, bumps the version in all required files, and populates the [CHANGELOG](./CHANGELOG.md) with merged PRs since the last tag automatically | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't recommend having Add relevant steps there. maybe, sometime in near future, if claude gets replaced by other LLM, the release docs will still be relevant ( both manual and automated ) |
||||||
| 2. Review the `### What's Changed` entries in [CHANGELOG.md](./CHANGELOG.md) and adjust if needed, then commit any edits | ||||||
| 3. Make a PR against `main` | ||||||
| 4. Once the PR is approved, merge it into `main` | ||||||
| 5. Create the release and the release tag on Github including populating the release notes | ||||||
|
||||||
| 5. Create the release and the release tag on Github including populating the release notes | |
| 5. Create the release and the release tag on GitHub including populating the release notes |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe apply regex here to change all versions in all files excluding
CHANGELOG.md.So, we don't need to manually specify each file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I afraid if we ask him to use regexp we can accidentally bump libraries that we shouldn't simply because they have the same version as ably-java. I want to be extremely caution here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add some exceptions, then regex should work fine wdyt