-
Notifications
You must be signed in to change notification settings - Fork 678
build: automate release packaging and version bumps with changesets #2483
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2483 +/- ##
=======================================
Coverage 93.09% 93.09%
=======================================
Files 40 40
Lines 11239 11239
Branches 713 713
=======================================
Hits 10463 10463
Misses 764 764
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
zimeg
left a comment
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.
Noting some additional nuance and thoughts in these changes for the wonderful reviewers 🌚
|
|
||
| 7. Close GitHub Milestone | ||
| - Close the relevant GitHub Milestone for the release | ||
| When a PR containing changesets is merged to `main`, a different PR is opened or updating using [changesets/action](https://github.com/changesets/action) which consumes the pending changesets, bumps relevant package versions, and updates various `CHANGELOG` files in preparation to release. |
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.
📚 note: The CHANGELOG file specific to each package might match what's shown in GitHub releases but also perhaps we can use this downstream in documentation?
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.
question: How does changesets/action know what version to bump the package to? Is it part of the npm run changeset command?
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 changesets/action step decides either to update the release PR or create a new release if all previous changesets were removed after merging that release PR.
We only expose the changeset script for adding new entries in development since CI ought handle the rest of this for production releases 🤖
| { | ||
| "name": "@slack/client", | ||
| "version": "5.0.2", | ||
| "private": true, |
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.
👁️🗨️ note: These package are EOL and shouldn't be published so the private field is used.
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.
question: Should we add rtm-api to the private: true list as well? It's often referred to as legacy but I'm not sure if it's officially EOL.
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.
@mwbrooks I'm curious about this too, but perhaps we add this to discussion in #2359? IIRC classic apps might still use this but I agree that since it's deprecated we might also mark this package as EOL.
📚 https://docs.slack.dev/changelog/2024-09-legacy-custom-bots-classic-apps-deprecation/
| - name: Setup Node | ||
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | ||
| with: | ||
| node-version: 24 |
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.
📺 note: We're using node@24 for a supported npm version:
Trusted publishing requires npm CLI version 11.5.1 or later.
mwbrooks
left a comment
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.
✅ Super exciting! I'm looking forward to seeing changesets in action and wondering if we can bring it to our other projects, if it's a success!
✏️ Left minor comments that are non-blocking!
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [] |
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.
question: Should we explicitly ignore our legacy packages? I know we currently use private: true in each legacy package to prevent publishing, so ignoring may not be necessary.
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.
@mwbrooks This is recommended against and instead ignore is meant to be used for stopgap times when we might want to not publish certain packages in the next release:
THIS FEATURE IS DESIGNED FOR TEMPORARY USE TO ALLOW CHANGES TO BE MERGED WITHOUT PUBLISHING THEM
|
|
||
| 7. Close GitHub Milestone | ||
| - Close the relevant GitHub Milestone for the release | ||
| When a PR containing changesets is merged to `main`, a different PR is opened or updating using [changesets/action](https://github.com/changesets/action) which consumes the pending changesets, bumps relevant package versions, and updates various `CHANGELOG` files in preparation to release. |
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.
question: How does changesets/action know what version to bump the package to? Is it part of the npm run changeset command?
| 9. Communicate the release (as appropriate) | ||
| - **Internal** | ||
| - Include a brief description and link to the GitHub release | ||
| 3. **Merge and approve**: Merge the release PR, then approve the publish workflow to release packages to npm. |
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.
👌🏻
| { | ||
| "name": "@slack/client", | ||
| "version": "5.0.2", | ||
| "private": true, |
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.
question: Should we add rtm-api to the private: true list as well? It's often referred to as legacy but I'm not sure if it's officially EOL.
| "devDependencies": { | ||
| "@biomejs/biome": "^2.0.5" | ||
| "@biomejs/biome": "^2.0.5", | ||
| "@changesets/cli": "^2.29.8" |
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.
question: Do we need @changeset/cli when npm run changeset → npx @changesets/cli runs the package instead of the cli?
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.
@mwbrooks I understand having this listed with dev dependencies guarantees a certain version will be used for the command:
$ npm run changeset
While npx might install a breaking change in CI. Hoping to keep this for now for confidence in shared tooling 💌
| publish: npm run changeset -- publish | ||
| version: npm run changeset -- version | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
question: Do we need a NPM_TOKEN: ${{ secrets.NPM_TOKEN }}? How will npm run chahgeset -- publish release the packages without the token?
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.
@mwbrooks AFAICT OIDC is a replacement for the token authentications in most recent changes:
Publish packages without npm tokens
🔗 https://github.blog/changelog/2025-07-31-npm-trusted-publishing-with-oidc-is-generally-available/
.github/workflows/release.yml
Outdated
| environment: publish | ||
| permissions: | ||
| contents: write | ||
| id-token: write |
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.
suggestion: Sounds like id-token: write is used for npm OIDC trusted publishing? I think a comment would be nice here.
| id-token: write | |
| # required for npm OIDC trusted publishing | |
| id-token: write |
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.
Co-authored-by: Michael Brooks <mbrooks@slack-corp.com>
|
@mwbrooks So much great feedback! Thanks for reviewing this with better maintenance in mind 🧠 ✨ As we merge this I'm making a few more changes noted earlier:
We'll hold off on pre-releases for now and might update new milestones with |
|
👁️🗨️ We're caught with the unexpected versioning of "@slack/cli-test@2.2.0+cli.2.32.2" version: 🔗 https://github.com/slackapi/node-slack-sdk/actions/runs/21500089838/job/61944289914#step:5:45 Let's fast follow this with an update to ignore publishing the |
|
📝 OIDC configurations have now been made per package for the following packages:
The Also, we've welcomed amazing @changeset-bot to this project in PRs 💌 |
|
This seems promising 🚀 💯 |
Summary
This PR adds Changesets to these packages for improved package release and publishing workflows:
The above command might be run alongside changes in packages to write entries for that package's next release. Other packages use this for detailed release notes as kind example:
@astrojs/rss: https://github.com/withastro/astro/blob/main/packages/astro-rss/CHANGELOG.md@biomejs/biome: https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/CHANGELOG.mdWe might consider adding this to our release workflows to automate version bumps between dependent packages - as example
@slack/web-apiimports@slack/types- in addition to the other release and publishing scripts.Preview
📚 https://github.com/slackapi/node-slack-sdk/blob/zimeg-build-changesets/.github/maintainers_guide.md#-updating-changesets
👾 Publish Workflow: We might experiment with the changes of #2474 to confirm that this publishes packages and creates releases as expected!
Notes
@slack/package@nextinstead of a set version.https://github.blog/changelog/2025-07-31-npm-trusted-publishing-with-oidc-is-generally-available/
publishGitHub Actions environment will also need to be setup with correct review permissions.Requirements