Skip to content

Commit 4cb5658

Browse files
WilliamBergaminClaudezimeg
authored
ci: automate versioning and releases with changesets (#60)
* feat(release): automate versioning and releases with changesets * chore(release): replace new_changeset.py with `npx @changesets/cli add` * update * use package.json * Update AGENTS.md * chore(release): drop unused import in sync_versions.py Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> * Update .github/maintainers_guide.md Co-authored-by: Eden Zimbelman <zim@o526.net> * Update .github/workflows/release.yml Co-authored-by: Eden Zimbelman <zim@o526.net> * Clean up maintainer-guide * add changeset to package.json * improve based on feedback * chore: require Node.js 26+ via engines field Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> --------- Co-authored-by: Claude <svc-devxp-claude@slack-corp.com> Co-authored-by: Eden Zimbelman <zim@o526.net>
1 parent 44af86d commit 4cb5658

11 files changed

Lines changed: 183 additions & 12 deletions

File tree

.changeset/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changesets
2+
3+
This directory contains [**Changesets**](https://github.com/changesets/changesets) which are markdown files that describe package changes for the next release.
4+
5+
For guidance on when and how to add changesets, checkout the [Maintainer's Guide](../.github/maintainers_guide.md#-updating-changesets).

.changeset/config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [],
11+
"privatePackages": {
12+
"version": true,
13+
"tag": true
14+
}
15+
}

.github/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ For your contribution to be accepted:
3939
- [x] The test suite must be complete and pass.
4040
- [x] The changes must be approved by code review.
4141
- [x] Commits should be atomic and messages must be descriptive. Related issues should be mentioned by Issue number.
42+
- [x] User-facing changes include a changeset (run `npx changeset add`). See [Updating Changesets](./maintainers_guide.md#-updating-changesets) for the format; releases are automated from these.
4243

4344
If the contribution doesn't meet the above criteria, you may fail our automated checks or a maintainer will discuss it with you. You can continue to improve a Pull Request by adding commits to the branch from which the PR was created.
4445

.github/dependabot.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ updates:
66
interval: "monthly"
77
open-pull-requests-limit: 5
88
labels:
9-
- "build"
10-
- "semver:patch"
9+
- "dependencies"
1110
- package-ecosystem: "github-actions"
1211
directory: "/"
1312
schedule:
1413
interval: "monthly"
1514
labels:
16-
- "build"
17-
- "semver:patch"
15+
- "dependencies"
16+
- package-ecosystem: "npm"
17+
directory: "/"
18+
schedule:
19+
interval: "monthly"
20+
versioning-strategy: increase
21+
labels:
22+
- "dependencies"

.github/maintainers_guide.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ brew update
2626
brew install pyenv
2727
```
2828

29-
Install necessary Python runtimes for development/testing. You can rely on GitHub Actions workflows for testing with various major versions. <https://github.com/slackapi/bolt-python/tree/main/.github/workflows>
29+
Install necessary Python runtime for development/testing.
3030

3131
```sh
3232
$ pyenv install 3.14 # select the latest patch version
@@ -46,14 +46,50 @@ source .venv/bin/activate
4646

4747
## Versioning
4848

49-
Follow the [conventional commit specification][conv-commits]. PR titles and
50-
commit messages use prefixes like `feat:`, `fix:`, `chore:`, `docs:`, etc.
51-
First letter after the prefix is lowercase unless it's a proper noun.
49+
Follow the [conventional commit specification][conv-commits]. PR titles and commit messages use prefixes like `feat:`, `fix:`, `chore:`, `docs:`, etc. First letter after the prefix is lowercase unless it's a proper noun.
5250

53-
### Plugin version bumps
51+
### 🎁 Updating Changesets
5452

55-
Every release must bump the `version` field in
56-
`.claude-plugin/plugin.json` and `.cursor-plugin/plugin.json` following [semver][semver].
53+
This project uses [Changesets](https://github.com/changesets/changesets) to track changes and automate releases.
54+
55+
Each changeset describes a change to the package and its [semver][semver] impact, and a new changeset should be added when updating the package with some change that affects consumers:
56+
57+
```sh
58+
npx changeset add
59+
```
60+
61+
Alternatively, hand-write a file named `.changeset/<anything>.md`, with this format:
62+
63+
```md
64+
---
65+
"slack": minor
66+
---
67+
68+
Add the channel-digest command
69+
```
70+
71+
The frontmatter key is always `"slack"`; the value is the [semver][semver] bump level, like `patch`, `minor`, or `major`. The body becomes the changelog entry, so write it for a reader of the release notes.
72+
73+
Updates to documentation, tests, or CI might not require new entries.
74+
75+
When a PR containing changesets is merged to `main`, a different PR is opened or updated using [changesets/action](https://github.com/changesets/action) which consumes the pending changesets, bumps the package version, and updates the `CHANGELOG` in preparation to release.
76+
77+
### 🚀 Releases
78+
79+
Releasing can feel intimidating at first, but don't fret! Venture on!
80+
81+
New official package versions are published when the release PR created from changesets is merged. Follow these steps to build confidence:
82+
83+
1. **Run the tests locally**: Before merging the release PR please run all the tests especially the eval ones. If they no longer pass we may need fix it before releasing the changes.
84+
85+
2. **Check GitHub**: Please check if issues or pull requests are still open either decide to postpone the release or save those changes for a future update.
86+
87+
3. **Review the release PR**: Verify that the version bump matches expectations, `CHANGELOG` entries are clear, and CI checks pass.
88+
89+
4. **Merge and approve**: Merge the release PR. It may take up to 24 hours before you see you release in the [Claude Plugins](https://claude.com/plugins/slack) directory.
90+
91+
5. **Communicate the release**:
92+
- **External**: Post in relevant channels (e.g. #lang-javascript, #tools-bolt) on [Slack Community](https://community.slack.com/). Include a link to the release notes.
5793

5894
## Everything Else
5995

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# Don't let two release runs race on the same branch.
10+
concurrency: ${{ github.workflow }}-${{ github.ref }}
11+
12+
env:
13+
PY_VERSION: "3.14"
14+
NODE_VERSION: "26"
15+
16+
jobs:
17+
release:
18+
name: Release
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
steps:
25+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
26+
with:
27+
fetch-depth: 0
28+
persist-credentials: false
29+
- name: Set up Node ${{ env.NODE_VERSION }}
30+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
31+
with:
32+
node-version: ${{ env.NODE_VERSION }}
33+
- name: Set up Python ${{ env.PY_VERSION }}
34+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
35+
with:
36+
python-version: ${{ env.PY_VERSION }}
37+
- name: Install Node dependencies
38+
run: npm install
39+
- name: Changesets release
40+
uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0
41+
with:
42+
version: bash scripts/changeset_version.sh
43+
publish: npx changeset publish
44+
commit: "chore: release"
45+
title: "chore: release"
46+
prDraft: create
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,11 @@ GitHub Actions (`.github/workflows/ci-build.yml`) gates every PR with:
5858
- **Test**`make test-unit` (pytest)
5959

6060
LLM-judged tests are not run in CI (Ollama + model download would exceed time budget).
61+
62+
## Releasing
63+
64+
Releases are automated and run in CI — **you never run a release yourself.** Your only release-related task is adding a changeset when a PR makes a user-facing change.
65+
66+
See the [maintainers guide](.github/maintainers_guide.md#-updating-changesets) for the format.
67+
68+
Everything after that is handled by [changesets](https://github.com/changesets/changesets) and `scripts/changeset_version.sh`: merging to `main` opens a "chore: release" PR, and merging that PR publishes the release.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ install-tools: $(VENV) ## Install linting/formatting tools (ruff)
6565

6666
clean: ## Remove virtual environment, Ollama, and local Cursor install
6767
-$(PYTHON) scripts/cursor.py uninstall
68-
rm -rf $(VENV) $(OLLAMA_DIR)
68+
rm -rf $(VENV) $(OLLAMA_DIR) node_modules
6969

7070
cursor-install: $(VENV) ## Install this plugin into a local Cursor for development
7171
$(PYTHON) scripts/cursor.py install

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "slack",
3+
"version": "1.1.0",
4+
"private": true,
5+
"engines": {
6+
"node": ">=26"
7+
},
8+
"devDependencies": {
9+
"@changesets/cli": "^2.31.0"
10+
}
11+
}

scripts/changeset_version.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
npx changeset version
5+
python scripts/sync_versions.py

0 commit comments

Comments
 (0)