Skip to content

Commit cfcbac1

Browse files
committed
Add CI-releasing setup
1 parent 8eb78cd commit cfcbac1

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- main
78
- 'v*'
89
pull_request: {}
910
schedule:

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
name: Publish to npm
11+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Install node
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 16.x
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: install dependencies
24+
run: yarn install --frozen-lockfile --ignore-engines
25+
26+
- name: auto-dist-tag
27+
run: npx auto-dist-tag --write
28+
29+
- name: publish to npm
30+
run: npm publish
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@
126126
"github": {
127127
"release": true,
128128
"tokenRef": "GITHUB_AUTH"
129+
},
130+
"npm": {
131+
"publish": false
129132
}
130133
}
131134
}

0 commit comments

Comments
 (0)