Skip to content

Commit 8266211

Browse files
committed
chore: add semantic release configuration and GitHub Actions workflow
1 parent 676bd44 commit 8266211

3 files changed

Lines changed: 57 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "src/**"
8+
- "package.json"
9+
- ".github/workflows/release.yml"
10+
11+
permissions:
12+
contents: write
13+
issues: write
14+
pull-requests: write
15+
id-token: write
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
26+
- uses: pnpm/action-setup@v4
27+
with:
28+
version: 10
29+
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 22
33+
cache: pnpm
34+
35+
- run: pnpm install
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Run tests
41+
run: npm run test
42+
43+
- name: Release
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
NPM_CONFIG_PROVENANCE: true
48+
run: npx semantic-release

.releaserc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/npm",
7+
"@semantic-release/github"
8+
]
9+
}

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
"deploy": "npm run doc:gen && npm run build:demo && gh-pages -d dist",
4242
"test": "vitest run",
4343
"test:watch": "npm test -- --watch",
44-
"preversion": "npm run build",
45-
"postversion": "npm publish",
46-
"postpublish": "git push --follow-tags && npm run deploy",
4744
"serve": "vite preview"
4845
},
4946
"repository": {

0 commit comments

Comments
 (0)