Skip to content

Commit

Permalink
chore: add github action to release automatically with changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkr00t committed Apr 16, 2020
1 parent 5b1f6cc commit caa66ba
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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
uses: changesets/action@master
with:
# this expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn ci:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"ci:build": "yarn build",
"ci:test:cov": "nyc --reporter=lcov yarn test",
"ci:release": "changeset publish",
"test": "ava",
"test:cov": "nyc --reporter=lcov --reporter=text yarn test",
"build": "yarn build:ts && yarn build:core:cli",
Expand Down

0 comments on commit caa66ba

Please sign in to comment.