Skip to content

Commit aae67e5

Browse files
committed
feat: add release workflow
1 parent 83bb590 commit aae67e5

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- run: npm install
1515
- run: npm run lint:check
1616
- run: npm run format:check
17+
1718
build:
1819
runs-on: ubuntu-latest
1920
steps:
@@ -24,3 +25,30 @@ jobs:
2425
node-version: 16.x
2526
- run: npm install
2627
- run: npm run build
28+
29+
commitlint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
with:
35+
fetch-depth: 0
36+
- name: Lint Commit
37+
uses: wagoid/commitlint-github-action@v3
38+
39+
release:
40+
name: Publish new release
41+
needs: [build, lint, commitlint]
42+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v2
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v2
49+
with:
50+
node-version: 14
51+
- name: Release
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
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)