Skip to content

Commit

Permalink
add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisKo committed Mar 6, 2021
1 parent 264b0b4 commit c0d1b57
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches:
- main

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:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"module": "lib/index.esm.js",
"author": "dennisko <[email protected]>",
"license": "MIT",
"files": [
"lib"
],
"devDependencies": {
"@babel/core": "^7.13.8",
"@changesets/cli": "^2.14.1",
Expand Down Expand Up @@ -40,6 +43,7 @@
"build-storybook": "build-storybook",
"test": "jest",
"test:watch": "jest --watch",
"build": "rollup -c"
"build": "rollup -c",
"release": "yarn build && changeset publish"
}
}

0 comments on commit c0d1b57

Please sign in to comment.