Skip to content

Commit 34d58b2

Browse files
committed
feat: add release workflow and CI
1 parent 18fc981 commit 34d58b2

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Node.js CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Use Node.js 16.x
11+
uses: actions/[email protected]
12+
with:
13+
node-version: 16.x
14+
- run: npm install
15+
- run: npm run build
16+
17+
commitlint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
- name: Lint Commit
25+
uses: wagoid/commitlint-github-action@v3
26+
27+
release:
28+
name: Publish new release
29+
needs: [build, commitlint]
30+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v2
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v2
37+
with:
38+
node-version: 14
39+
- name: Release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: npx semantic-release

.releaserc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
[
9+
"@semantic-release/github",
10+
{
11+
"successComment": false,
12+
"releasedLabels": false
13+
}
14+
]
15+
]
16+
}

0 commit comments

Comments
 (0)