Skip to content

Commit 11c2b0d

Browse files
committed
build: Github actions
1 parent 4b7c48b commit 11c2b0d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/ci.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
build:
7+
name: 'Test on Node ${{ matrix.node }} and ${{ matrix.os }}'
8+
runs-on: '${{ matrix.os }}'
9+
strategy:
10+
# max-parallel: 1
11+
matrix:
12+
node:
13+
- 16
14+
os:
15+
- ubuntu-latest
16+
steps:
17+
- name: 'Checkout repository'
18+
uses: actions/checkout@v2
19+
- name: 'Setup Node ${{ matrix.node }}'
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: '${{ matrix.node }}'
23+
- name: 'Install depependencies'
24+
run: npm install
25+
- name: 'Test'
26+
run: npm run test
27+
release:
28+
name: 'Release'
29+
runs-on: ubuntu-latest
30+
needs: build
31+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next')
32+
steps:
33+
- name: 'Checkout repository'
34+
uses: actions/checkout@v2
35+
- name: 'Setup Node'
36+
uses: actions/setup-node@v2
37+
with:
38+
node-version: 16
39+
- name: 'Install depependencies'
40+
run: npm install
41+
- name: 'Build'
42+
run: npm run build
43+
- name: 'Release'
44+
run: |
45+
npx semantic-release
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)