Skip to content

Commit

Permalink
Automate releases to NPM (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
danoc authored Dec 19, 2020
1 parent af3b0a7 commit a38e89e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1,196 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-numbers-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"clickable-box": patch
---

Use changeset for automatic releases to NPM
9 changes: 6 additions & 3 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Version
name: Publish

on:
push:
Expand All @@ -7,7 +7,7 @@ on:

jobs:
version:
name: Release PR
name: Create release PR or publish to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -28,7 +28,10 @@ jobs:
- name: Install dependencies
run: |
yarn install --frozen-lockfile
- name: Create or update release PR
- name: Create release PR or publish to NPM
uses: changesets/action@master
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
"test:eslint": "eslint . --ignore-path .gitignore --ext .jsx --ext .js --ext .tsx --ext .ts",
"test:jest": "jest",
"test:prettier": "prettier \"**/*.{js,jsx,ts,tsx,css,scss,json,md,mdx,html}\" --list-different",
"prepublishOnly": "microbundle --jsx React.createElement",
"format": "prettier \"**/*.{js,jsx,ts,tsx,css,scss,json,md,mdx,html}\" --write",
"release": "np"
"release": "rm -rf dist && yarn install --frozen-lockfile && yarn test && yarn microbundle --jsx React.createElement && yarn changeset release"
},
"devDependencies": {
"@babel/preset-typescript": "^7.12.7",
Expand All @@ -37,7 +36,6 @@
"husky": "^4.3.6",
"jest": "^26.6.3",
"microbundle": "^0.12.4",
"np": "^7.0.0",
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0",
"react": "^17.0.1",
Expand Down
Loading

0 comments on commit a38e89e

Please sign in to comment.