Skip to content

Commit 62e7f58

Browse files
committed
ci: add publish process
1 parent 6b508a7 commit 62e7f58

File tree

5 files changed

+12038
-3606
lines changed

5 files changed

+12038
-3606
lines changed

.github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [12.x, 14.x, 16.x]
15+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
cache: 'npm'
23+
- run: npm ci
24+
- run: npm run build --if-present
25+
- run: npm test
26+
27+
release:
28+
runs-on: ubuntu-latest
29+
needs: ['test']
30+
if: "!contains(github.event.head_commit.message, 'skip-release') && !contains(github.event.head_commit.message, 'skip-ci') && github.event_name != 'pull_request'"
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: actions/setup-node@v2
34+
with:
35+
node-version: 16.x
36+
- run: npm i
37+
- run: npx semantic-release --branches main
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 16.x
19+
20+
- run: npx changelogithub
21+
env:
22+
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}

.github/workflows/test.yml

-31
This file was deleted.

0 commit comments

Comments
 (0)