-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WB-586: Add changesets to automate the release process
Summary: - Introduces `changesets` to the repository. - Adds a new workflow to handle releases. This will be triggered after the "release coordinator" (one of WB's admins) has approved the release (by hitting the `Merge` button). - Creates a new `release` script to handle releases using `changesets` instead of `lerna`. (keeping `lerna/publish` for backwards compatibility). More info about the new release process here: https://www.figma.com/file/xaYyzIuKLxqXAJVAl3y1S4/Wonder-Blocks-Web-Eng-process?node-id=50%3A400 NOTE: To include a regular PR in the release PR, the PR's author will need to run `yarn changesets` to include the changes for each package they have changed. More info about using it on this part of the process here: https://www.figma.com/file/xaYyzIuKLxqXAJVAl3y1S4/Wonder-Blocks-Web-Eng-process?node-id=81%3A549 Issue: https://khanacademy.atlassian.net/browse/WB-586 Test plan: Merge this PR and verify that the "Release PR" gets created after a contributor lands a PR (merges it into `master`).
- Loading branch information
Showing
5 changed files
with
619 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config@1.6.2/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "master", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@master | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can | ||
# generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js 12.x | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Install Dependencies | ||
run: yarn | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@master | ||
with: | ||
publish: yarn release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Send a Slack notification if a publish happens | ||
- uses: rtCamp/action-slack-notify@v2 | ||
if: steps.changesets.outputs.published == 'true' | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_CHANNEL: wonder-blocks-eng | ||
SLACK_MSG_AUTHOR: ${{ github.event.pull_request.user.login }} | ||
SLACK_USERNAME: GithubGoose | ||
SLACK_ICON_EMOJI: ":goose:" | ||
SLACK_MESSAGE: "A new version of ${GITHUB_REPOSITORY} was published! [Release notes →](<https://github.com/Khan/wonder-blocks/releases/>)" | ||
SLACK_TITLE: "New Wonder Blocks release!" | ||
SLACK_FOOTER: Wonder Blocks Slack Notification | ||
MSG_MINIMAL: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.