-
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.
Browse files
Browse the repository at this point in the history
## 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 <img width="2890" alt="Wonder Blocks Web Eng process" src="https://user-images.githubusercontent.com/843075/142078849-75ec28bf-98b5-4c55-b3f6-de2d63a4d90d.png"> 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: 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`). Here's an example of how the `Release PR` will look: emotion-js/emotion#2394 Author: jandrade Reviewers: kevinbarabash, jandrade Required Reviewers: Approved By: kevinbarabash Checks: ✅ codecov/project, ✅ Mixed content, ⚪️ Redirect rules, ⚪️ Header rules, ⚪️ Pages changed, ✅ gerald, ✅ lint_and_test (ubuntu-latest, 12), ⏭ dependabot, ✅ chromatic (ubuntu-latest, 12) Pull Request URL: #1221
- Loading branch information
Showing
5 changed files
with
649 additions
and
13 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,70 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
# This workflow will run changesets depending on two different scenarios: | ||
# | ||
# 1. If we are landing a specific commit into master (Author PR), then | ||
# changesets will check if there are changes verifying the Markdown files | ||
# generated automatically: | ||
# | ||
# a) There are new versions and there's NO Release PR, then the changesets | ||
# action will create a new Release PR. | ||
# | ||
# b) There's a Release PR, then the changesets action will update the | ||
# existing Release PR with the new commit. | ||
# | ||
# NOTE: (in both cases, changesets will modify the new version in | ||
# package.json for each package, and will remove the MD files as part of the | ||
# Release PR). | ||
# | ||
# 2. If we are landing the Release PR into master, then the changesets action | ||
# will publish the changes to npm. | ||
# | ||
# For more info about this workflow, see: | ||
# https://github.com/changesets/action#usage | ||
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 publish:ci | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Send a Slack notification if a publish happens | ||
if: steps.changesets.outputs.published == 'true' | ||
uses: rtCamp/action-slack-notify@v2 | ||
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.