Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changesets

This directory contains [**Changesets**](https://github.com/changesets/changesets) which are markdown files that describe package changes for the next release.

For guidance on when and how to add changesets, checkout the [Maintainer's Guide](../.github/maintainers_guide.md#-updating-changesets).
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Copy link
Member

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.

Copy link
Member Author

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

🔗 https://github.com/changesets/changesets/blob/main/docs/config-file-options.md#ignore-array-of-packages

}
81 changes: 23 additions & 58 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,86 +62,51 @@ npm run docs --workspace packages/web-api

The script places the reference markdown files in `/docs/english/reference/package-name`.

### 🚀 Releases

_For beta releases, see [**Beta Releases**](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-beta-releases) section below_

Releasing can feel intimidating at first, but rest assured: if you make a mistake, don't fret! npm allows you to unpublish a release within the first 72 hours of publishing (you just won’t be able to use the same version number again). Venture on!

1. Check the status of the package's GitHub Milestone for issues that should be shipped with the release.
- If all issues have been closed, continue with the release.

- If issues are still open, discuss with the team about whether the open issues should be moved to a future release or if the release should be held off until the issues are resolved.

- Take a look at all issues under the Milestone to make sure that the type of issues included aligns with the Milestone name based on [semantic versioning](https://semver.org/). If the issues do not align with the naming of the Milestone (ex: if the issues are all bug fixes, but the Milestone is labeled as a minor release), then you can tweak the Milestone name to reflect the correct versioning.

2. Make sure your local `main` branch has the latest changes (i.e. `git checkout main && git pull --tags origin main`). Then, open a new branch off of your local `main` branch for the release (i.e. `git checkout -b <package>-<release>`).

3. For each package to be released, run `npm test --workspace packages/<package-name>` to verify that tests are passing.

4. On our new branch, bump the version(s) in `package.json` (see [Versioning and Tags](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#-versioning-and-tags))
- Generate the reference docs for that package by running `npm run docs --workspace packages/<package-name>`.

- Make a single commit for the version(s) bump, following the format in: ([Example](https://github.com/slackapi/node-slack-sdk/commit/ff03f7812c678bdc5cea5eace75db34631a88dda))
### 🎁 Updating Changesets

- Create a pull request for the version change ([Example](https://github.com/slackapi/node-slack-sdk/pull/2402))
This project uses [Changesets](https://github.com/changesets/changesets) to track changes and automate releases.

- Add appropriate labels on the PR, including `release`, `pkg:*`, and `semver:*`
Each changeset describes a change to a package and its [semver](https://semver.org/) impact, and a new changeset should be added when updating a published package with some change that affects consumers of the package:

- Add appropriate milestone on the PR

5. Once the PR has been approved and tests have passed, merge it into the main repository.
- Check out your local `main` branch and update it to get the latest changes: `git checkout main && git pull origin main`

- Add a version tag (ie, `git tag @slack/web-api@5.6.0`)

- Push the new tag up to origin: `git push origin @slack/web-api@5.6.0`

6. Publish the release to npm
- To publish, you need to be a member of the `slack Org` on npm and set up 2-Factor Auth with your password generator of choice. Before you can publish with npm, you must run `npm login` from the command line.

- As the final validation, run `rm -rf packages/types/dist && npm test --workspace packages/types && npm pack --workspace packages/types` and confirm if there are `*.js`, `*.d.ts` files under the `dist` directory.

- Run `npm publish --workspace packages/types --otp YOUR_OTP_CODE`. To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password)
```sh
npm run changeset
```

7. Close GitHub Milestone
- Close the relevant GitHub Milestone for the release
Updates to documentation, tests, or CI might not require new entries.

- Check the existing GitHub Milestones to see if the next minor version exists. If it doesn't, then create a GitHub Milestone for new issues to live in. Typically, you'll create a new minor version - however, if there are any bugs that need to be carried over from the current GitHub Milestone, you could make a Milestone for a patch version to reflect those issues
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.
Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Member Author

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 🤖


- Move any unfinished, open issues to the next GitHub Milestone
### 🚀 Releases

8. Create GitHub Release with release notes
- From the repository, navigate to the **Releases** section and select [Draft a new release](https://github.com/slackapi/node-slack-sdk/releases/new)
Releasing can feel intimidating at first, but don't fret! If you make a mistake, npm allows you to unpublish within the first 72 hours. The one catch is that you can't reuse the same version number. Venture on!

- When creating the release notes, select the tag you generated earlier for your release and title the release the same name as the tag
> For beta releases, read the [**Beta Releases**](#-beta-releases) section below.

- To see a list of changes between the last tag for the specific package, you can use this `git` command: `git log --oneline --full-history @slack/types@2.8.0..@slack/types@2.9.0 -- packages/types`. Sub in the correct tags and the last argument should be the path to the sub-package you are releasing (in order to filter commits just to the specific path).
New official package versions are published when the release PR created from changesets is merged and the publish workflow is approved. Follow these steps to build confidence:

- Release notes should mention contributors, issues, PRs, milestone, and link to npm package ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%402.17.0))
1. **Check GitHub Milestones**: Before merging the release PR please check the relevant [Milestones](https://github.com/slackapi/node-slack-sdk/milestones). If issues or pull requests are still open either decide to postpone the release or save those changes for a future update.

- Once the release notes are ready, click the "Publish Release" button to make them public
2. **Review the release PR**: Verify that version bumps match expectations, `CHANGELOG` entries are clear, and CI checks pass.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏻


- **External**
- **Slack Community Hangout** (`community.slack.com/`) in **#lang-javascript**. Include a link to the package on `npmjs.com/package/@slack/` as well as the release notes. ([Example](https://community.slack.com/archives/CHF1FKX4J/p1657293144932579))
4. **Update Milestones**: Close the relevant [Milestones](https://github.com/slackapi/node-slack-sdk/milestones) and rename these to match the released package versions. Open a new Milestone for the next version, e.g. `@slack/web-api@next`.

- **Twitter**: Primarily for major updates. Coordinate with Developer Marketing.
5. **Communicate the release**:
- **Internal**: Post a brief description and link to the GitHub release.
- **External**: Post in **#lang-javascript** on [Slack Community](https://community.slack.com/). Include a link to the package on `npmjs.com/package/@slack/` as well as the release notes.

### 🚧 Beta Releases

1. Make sure your local `main` branch has the latest changes
- Run `git rebase main` from your feature branch (this will rebase your feature branch from `main`). You can opt for `git merge main` if you are not comfortable with rebasing.
1. Make sure your local `main` branch has the latest changes
- Run `git rebase main` from your feature branch (this will rebase your feature branch from `main`). You can opt for `git merge main` if you are not comfortable with rebasing.

- If you do not have a feature branch, you can also use generic release candidate branch name like `<next-version>rc`, i.e. `2.5.0rc`.

2. For each package to be released, run `npm test --workspace packages/<package-name>` to verify that tests are passing.

3. Bump the version(s) in `package.json`
- The version must be in the format of `Major.Minor.Patch-BetaNamespace.BetaVersion` (ex: `5.10.0-workflowStepsBeta.1`, `2.5.0-rc.1`)
- The version must be in the format of `Major.Minor.Patch-BetaNamespace.BetaVersion` (ex: `5.10.0-workflowStepsBeta.1`, `2.5.0-rc.1`)

- Make a single commit for the version bump ([Example](https://github.com/slackapi/node-slack-sdk/commit/1503609d79abf035e9e21bad7360e124e4211594))

Expand Down Expand Up @@ -170,7 +135,7 @@ Releasing can feel intimidating at first, but rest assured: if you make a mistak

- Release notes should mention the beta feature (if applicable), contributors, issues and PRs ([Example](https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%401.8.0-workflowStepsBeta.2))

- Select the **This is a pre-release** checkbox
- Select the **This is a pre-release** checkbox

## 📥 Workflow

Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: publish
permissions:
contents: write
id-token: write # OIDC: https://docs.npmjs.com/trusted-publishers
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true

- name: Setup Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 24
Copy link
Member Author

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.

🔗 https://docs.npmjs.com/trusted-publishers

registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm install

- name: Gather changesets
uses: changesets/action@c48e67d110a68bc90ccf1098e9646092baacaa87 # v1.6.0
with:
createGithubReleases: true
commit: "chore: release"
title: "chore: release"
publish: npm run changeset -- publish
version: npm run changeset -- version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Member

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?

Copy link
Member Author

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/

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"packages/webhook"
],
"scripts": {
"changeset": "npx @changesets/cli",
"lint": "npx @biomejs/biome check packages",
"lint:fix": "npx @biomejs/biome check --write packages"
},
"devDependencies": {
"@biomejs/biome": "^2.0.5"
"@biomejs/biome": "^2.0.5",
"@changesets/cli": "^2.29.8"
Copy link
Member

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?

Copy link
Member Author

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 💌

}
}
1 change: 1 addition & 0 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@slack/client",
"version": "5.0.2",
"private": true,
Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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/

"description": "Legacy wrapper for official Slack Platform's Web API, RTM API, and Incoming Webhook libraries. Use @slack/web-api, @slack/rtm-api, or @slack/webhook instead.",
"author": "Slack Technologies, LLC",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/events-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@slack/events-api",
"version": "3.0.1",
"private": true,
"description": "Official library for using the Slack Platform's Web API",
"author": "Slack Technologies, LLC",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/interactive-messages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@slack/interactive-messages",
"version": "2.0.2",
"private": true,
"description": "Official library for using the Slack Platform's Interactive Buttons, Menus, Dialogs, Actions, and Block Actions",
"author": "Slack Technologies, LLC",
"license": "MIT",
Expand Down