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#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": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/deep-tires-ask.md
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

📣 note: This arrived in #588 that we can include in the next release!

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"slack-github-action": patch
---

fix: resolve url.parse deprecation warning for webhook techniques
104 changes: 47 additions & 57 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,64 @@ A PR from a forked branch will fail this workflow until a maintainer reviews the
pull/<NUMBER>/head
```

### Releasing
### Documentation

1. Check the status of this project's GitHub [Milestone](https://github.com/slackapi/slack-github-action/milestones) to be released 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. Checkout a branch for the release:
This repo contains two types of docs files:

```sh
$ git checkout -b v1.2.3
```
- markdown files
- sidebar.json

3. Update the version in `package.json` and `package-lock.json` and examples:
The private repo containing the docs.slack.dev site pulls these in at build time.

```sh
$ npm version <major|minor|patch> --no-git-tag-version
```
Maintainers need to use the `run workflow` button associated with the `deploy` workflow in that private repo to update the docs with changes from here.

4. Run all tests with the latest dependencies to make sure tests pass:
#### Markdown Files

```sh
$ npm ci
$ npm test
```
The markdown files here are secretly mdx files in disguise.

If you'd like to add images to pages, add the image files to the same folder the md file is in.

We appreciate markdown edits from anyone!!!

#### Sidebar

5. Commit the changes on your release branch and open a pull request with relevant labels:
`_sidebar.json` sets the slack github action docs sidebar

sidebar values take the form of "slack-github-action/path-within-docs/"

or, in other words - full path but remove "docs":
path: slack-github-action/docs/sending-variables.md
value: slack-github-action/sending-variables

for info on syntax see https://docusaurus.io/docs/sidebar

this file is copied into slackapi.github.io/slack-github-action/sidebar.js it is then called in slackapi.github.io/sidebars.js

### Changesets

This project uses [Changesets](https://github.com/changesets/changesets) to track changes and automate releases.

Each changeset describes a change to the package and its [semver](https://semver.org/) impact, and a new changeset should be added when updating the package with some change that affects consumers:

```sh
$ git commit -m "chore(release): tag version 1.2.3"
$ git push -u origin v1.2.3
npm run changeset
```

6. After merging these changes into `main` create a new [release](https://github.com/slackapi/slack-github-action/releases/new) with a new tag - `v1.2.3` - on publish. Include relevant changes in the release notes!
7. Rebuild [documentation](#docs) with the latest versions.
8. Once released, make sure to close the relevant GitHub Milestone for the version you released.
Updates to documentation, tests, or CI might not require new entries.

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.

### Releases

New versions are published when the release PR created from changesets is merged and the publish workflow is approved. Follow these steps to build confidence:

1. **Check GitHub Milestones**: Before merging the release PR please check the relevant [Milestones](https://github.com/slackapi/slack-github-action/milestones). If issues or pull requests are still open either decide to postpone the release or save those changes for a future update.

2. **Review the release PR**: Verify that the version bump matches expectations, `CHANGELOG` entries are clear, and CI checks pass.

3. **Merge and approve**: Merge the release PR, then approve the publish workflow to release the action.

4. **Update Milestones**: Close the relevant [Milestones](https://github.com/slackapi/slack-github-action/milestones) and rename these to match the released version. Open a new Milestone for the next version.

## Workflow

Expand Down Expand Up @@ -123,39 +146,6 @@ level of information with labels. An issue should have **one** of the following
Issues are closed when a resolution has been reached. If for any reason a closed issue seems
relevant once again, reopening is great and better than creating a duplicate issue.

## Docs

This repo contains two types of docs files:

- markdown files
- sidebar.json

The private repo containing the docs.slack.dev site pulls these in at build time.

Maintainers need to use the `run workflow` button associated with the `deploy` workflow in that private repo to update the docs with changes from here.

### Markdown Files

The markdown files here are secretly mdx files in disguise.

If you'd like to add images to pages, add the image files to the same folder the md file is in.

We appreciate markdown edits from anyone!!!

### Sidebar

`_sidebar.json` sets the slack github action docs sidebar

sidebar values take the form of "slack-github-action/path-within-docs/"

or, in other words - full path but remove "docs":
path: slack-github-action/docs/sending-variables.md
value: slack-github-action/sending-variables

for info on syntax see https://docusaurus.io/docs/sidebar

this file is copied into slackapi.github.io/slack-github-action/sidebar.js it is then called in slackapi.github.io/sidebars.js

Comment on lines -126 to -158
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

📚 note: This section is moved before releases to match adjacent guides!

## Everything else

When in doubt, find the other maintainers and ask.
54 changes: 0 additions & 54 deletions .github/workflows/publish.yml

This file was deleted.

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

on:
push:
branches:
- main
workflow_dispatch:

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

jobs:
changelog:
name: Changelog
runs-on: ubuntu-latest
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: true

- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: npm
cache-dependency-path: package-lock.json
node-version-file: .nvmrc

- name: Install dependencies
run: npm ci --verbose

- name: Update release PR
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
with:
commit: "chore: release"
title: "chore: release"
version: npm run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +36 to +44
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👁️‍🗨️ note: Here's an example preview! zimeg#11


publish:
name: Publish
needs: changelog
if: needs.changelog.outputs.hasChangesets == 'false'
runs-on: ubuntu-latest
environment: publish
permissions:
contents: write
steps:
- name: Gather credentials
id: credentials
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ secrets.GH_APP_CLIENT_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}
permission-contents: write

- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: true
token: ${{ steps.credentials.outputs.token }}

- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: npm
cache-dependency-path: package-lock.json
node-version-file: .nvmrc

- name: Install dependencies
run: npm ci --verbose

- name: Build a production release
run: npm run build

- name: Gather version
id: version
run: |
VERSION="v$(node -p 'require("./package.json").version')"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "major=$(echo "$VERSION" | cut -d. -f1)" >> "$GITHUB_OUTPUT"
echo "minor=$(echo "$VERSION" | cut -d. -f1-2)" >> "$GITHUB_OUTPUT"
echo "$VERSION"
Comment on lines +84 to +91
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🐢 note: The major and minor versions are both used as floating tags and aren't considered immutable. That's just for tags that have a proper release:

If you want to be able to update the Git tag of a release later, do not create a release on GitHub. Instead, create a tag as follows...

🔗 https://docs.github.com/en/actions/how-tos/create-and-publish-actions/using-immutable-releases-and-tags-to-manage-your-actions-releases


- name: Check if release exists
id: check
run: |
if gh release view "$VERSION" &>/dev/null; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
env:
VERSION: ${{ steps.version.outputs.version }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release artifacts
if: steps.check.outputs.exists == 'false'
id: release
run: |
awk '/^## /{if(n++)exit}n' CHANGELOG.md | tail -n +3 > RELEASE.md
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b "release/$VERSION"
git rm -rf .
git checkout HEAD -- LICENSE
git checkout HEAD -- README.md
git checkout HEAD -- action.yml
git checkout HEAD -- cli/
git add --force dist/
git commit -m "chore: release"
git push origin "release/$VERSION"
SHA=$(git rev-parse HEAD)
git tag -f "$MAJOR" "$SHA"
git tag -f "$MINOR" "$SHA"
git push -f origin "$MAJOR" "$MINOR"
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
env:
VERSION: ${{ steps.version.outputs.version }}
MAJOR: ${{ steps.version.outputs.major }}
MINOR: ${{ steps.version.outputs.minor }}

- name: Create GitHub release
if: steps.check.outputs.exists == 'false'
run: gh release create "$VERSION" --target "$SHA" --title "Slack GitHub Action $VERSION" --notes-file RELEASE.md
env:
VERSION: ${{ steps.version.outputs.version }}
SHA: ${{ steps.release.outputs.sha }}
GH_TOKEN: ${{ steps.credentials.outputs.token }}
Loading
Loading