Skip to content

Commit e668591

Browse files
committed
ci: add CI actions for automated release
1 parent 28cc116 commit e668591

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@master
15+
with:
16+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js 12.x
20+
uses: actions/setup-node@master
21+
with:
22+
node-version: 12.x
23+
24+
- name: Install pnpm
25+
run: npm i -g pnpm
26+
27+
- name: Install Dependencies
28+
run: pnpm i
29+
30+
- name: Create Release Pull Request or Publish to npm
31+
id: changesets
32+
uses: changesets/action@master
33+
with:
34+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
35+
publish: pnpm release
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"postinstall": "husky install",
1616
"prepublishOnly": "pinst --disable",
1717
"publish": "pnpm -r publish --dry-run",
18-
"postpublish": "pinst --enable"
18+
"postpublish": "pinst --enable",
19+
"release": "pnpm build && changeset release"
1920
},
2021
"private": true,
2122
"repository": {

0 commit comments

Comments
 (0)