Skip to content

Instantly share code, notes, and snippets.

@johno
Last active April 10, 2020 15:53
Show Gist options
  • Save johno/d0a49458d33369cf9331296e6d8c3955 to your computer and use it in GitHub Desktop.
Save johno/d0a49458d33369cf9331296e6d8c3955 to your computer and use it in GitHub Desktop.

Set up changesets with a release GitHub Action

Changesets is the raddest way to manage monorepos. You can combine changesets with GitHub Actions to automate releases.


Install changesets CLI.


Add changeset to package.json.


Add publish script to package.json.


Create test yaml file in .github/workflows.

name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@master
- name: Set up node
uses: actions/setup-node@master
with:
node-version: 12.x
- name: Install
run: yarn
- name: Create release pull request
uses: changesets/action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Create a GitHub action to run yarn test


Create test yaml file in .github/workflows.

name: Test
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up node
uses: actions/setup-node@master
with:
node-version: 12.x
- name: Install
run: yarn
- name: Test
run: yarn test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment