Skip to content

Commit 064e8fb

Browse files
committed
chore: add skill to run through release process (Claude Code)
1 parent 45cf5b7 commit 064e8fb

2 files changed

Lines changed: 64 additions & 1 deletion

File tree

.claude/commands/release.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 `pyproject.toml` (the `version` 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+
- `pyproject.toml` — the `version` property
20+
- `ably/__init__.py` — lib_version value
21+
3.Run `uv sync` to update `uv.lock` file
22+
4. Commit all files together with message: `chore: bump version to NEW_VERSION`
23+
3. Fetch merged PRs since the last release tag using:
24+
```
25+
gh pr list --state merged --base main --json number,title,mergedAt --limit 200
26+
```
27+
Then get the date of the last release tag with:
28+
```
29+
git log vOLD_VERSION --format="%aI" -1
30+
```
31+
Filter the PRs to only those merged after that tag date. Format each as:
32+
```
33+
- Short, one sentence summary from PR title and description [#NUMBER](https://github.com/ably/ably-java/pull/NUMBER)
34+
```
35+
If the tag doesn't exist or there are no merged PRs, use a single `-` placeholder bullet instead.
36+
37+
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:
38+
39+
```
40+
## [NEW_VERSION](https://github.com/ably/ably-java/tree/vNEW_VERSION)
41+
42+
[Full Changelog](https://github.com/ably/ably-java/compare/vOLD_VERSION...vNEW_VERSION)
43+
44+
### What's Changed
45+
46+
BULLETS_FROM_STEP_3
47+
48+
```
49+
50+
5. Commit `CHANGELOG.md` with message: `docs: update CHANGELOG for NEW_VERSION release`
51+
52+
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.

CONTRIBUTING.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ uv sync --extra crypto
2121
uv run pytest
2222
```
2323

24-
## Release Process
24+
## Release Process (Claude Code)
25+
26+
1. Ensure that all work intended for this release has landed to `main`
27+
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
28+
3. Review the `### What's Changed` entries in [CHANGELOG.md](./CHANGELOG.md) and adjust if needed, then commit any edits
29+
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`
30+
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`
31+
6. Create the release on GitHub including populating the release notes
32+
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
33+
8. Update the [Ably Changelog](https://changelog.ably.com/) (via [headwayapp](https://headwayapp.co/)) with these changes
34+
35+
## Release Process (Manual)
2536

2637
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).
2738

0 commit comments

Comments
 (0)