diff --git a/.claude/commands/release.md b/.claude/commands/release.md new file mode 100644 index 00000000..635f9bf8 --- /dev/null +++ b/.claude/commands/release.md @@ -0,0 +1,52 @@ +--- +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 `pyproject.toml` (the `version` 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: + - `pyproject.toml` — the `version` property + - `ably/__init__.py` — lib_version value + 3.Run `uv sync` to update `uv.lock` file +4. Commit all files together with message: `chore: bump version to NEW_VERSION` +3. Fetch merged PRs since the last release tag using: + ``` + gh pr list --state merged --base main --json number,title,mergedAt --limit 200 + ``` + 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. + +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: + +``` +## [NEW_VERSION](https://github.com/ably/ably-java/tree/vNEW_VERSION) + +[Full Changelog](https://github.com/ably/ably-java/compare/vOLD_VERSION...vNEW_VERSION) + +### What's Changed + +BULLETS_FROM_STEP_3 + +``` + +5. Commit `CHANGELOG.md` with message: `docs: update CHANGELOG for NEW_VERSION release` + +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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14ebf54b..7d4a97cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,18 @@ uv sync --extra crypto uv run pytest ``` -## Release Process +## Release Process (Claude Code) + +1. Ensure that all work intended for this release has landed to `main` +2. 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 +3. Review the `### What's Changed` entries in [CHANGELOG.md](./CHANGELOG.md) and adjust if needed, then commit any edits +4. Create a release PR (ensure you include an SDK Team Engineering Lead and the SDK Team Product Manager as reviewers) and gain approvals for it, then merge that to `main` +5. Create a tag named like `v2.0.1` and push it to GitHub - e.g. `git tag v2.0.1 && git push origin v2.0.1` +6. Create the release on GitHub including populating the release notes +7. Go to the [Release Workflow](https://github.com/ably/ably-python/actions/workflows/release.yml) and ask [ably/team-sdk](https://github.com/orgs/ably/teams/team-sdk) member to approve publishing to the PyPI registry +8. Update the [Ably Changelog](https://changelog.ably.com/) (via [headwayapp](https://headwayapp.co/)) with these changes + +## Release Process (Manual) Releases should always be made through a release pull request (PR), which needs to bump the version number and add to the [change log](CHANGELOG.md).