Skip to content

Commit e1a6169

Browse files
feat: semantic-release
1 parent 47684ba commit e1a6169

File tree

4 files changed

+3048
-49
lines changed

4 files changed

+3048
-49
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: write
13+
issues: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4.2.2
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4.3.0
24+
with:
25+
node-version: '22.14.0'
26+
cache: 'yarn'
27+
28+
- name: Install dependencies
29+
run: yarn install --frozen-lockfile
30+
31+
- name: Run tests
32+
run: yarn test
33+
34+
- name: Build
35+
run: yarn build
36+
37+
- name: Release
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
run: npx semantic-release

.releaserc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"branches": ["master"],
3+
"tagFormat": "${version}",
4+
"plugins": [
5+
"@semantic-release/commit-analyzer",
6+
"@semantic-release/release-notes-generator",
7+
"@semantic-release/changelog",
8+
"@semantic-release/npm",
9+
[
10+
"@semantic-release/git",
11+
{
12+
"assets": ["package.json", "CHANGELOG.md"],
13+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
14+
}
15+
],
16+
"@semantic-release/github"
17+
]
18+
}

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"test:watch": "vitest",
3838
"test:coverage": "vitest run --coverage",
3939
"prepublishOnly": "yarn run build",
40-
"publish:dev": "yalc publish"
40+
"publish:dev": "yalc publish",
41+
"release": "semantic-release"
4142
},
4243
"keywords": [],
4344
"author": "",
@@ -58,6 +59,9 @@
5859
"@rollup/plugin-node-resolve": "^15.0.2",
5960
"@rollup/plugin-terser": "^0.4.4",
6061
"@rollup/plugin-typescript": "^11.1.0",
62+
"@semantic-release/changelog": "^6.0.3",
63+
"@semantic-release/git": "^10.0.1",
64+
"@semantic-release/npm": "^12.0.1",
6165
"@testing-library/dom": "^10.4.0",
6266
"@testing-library/jest-dom": "^6.6.3",
6367
"@testing-library/react": "^16.3.0",
@@ -76,6 +80,7 @@
7680
"rollup-plugin-dts": "^5.3.0",
7781
"rollup-plugin-peer-deps-external": "^2.2.4",
7882
"rxjs": "^7.8.2",
83+
"semantic-release": "^24.2.3",
7984
"tslib": "^2.5.0",
8085
"typescript": "^5.0.4",
8186
"vitest": "^0.31.0"

0 commit comments

Comments
 (0)