Skip to content

Commit aa652f6

Browse files
committed
feat: integrate semantic release for automated versioning and publishing
1 parent 2dfb1d2 commit aa652f6

5 files changed

Lines changed: 9541 additions & 3455 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Semantic Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
id-token: write
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
release:
15+
name: Semantic Release
16+
runs-on: ubuntu-latest
17+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20.x'
30+
cache: 'npm'
31+
registry-url: 'https://registry.npmjs.org'
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Build
37+
run: npm run build
38+
39+
- name: Run tests
40+
run: npm run test:ci
41+
42+
- name: Run semantic-release
43+
run: npx semantic-release
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.releaserc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/npm",
8+
{
9+
"npmPublish": true,
10+
"tarballDir": "dist"
11+
}
12+
],
13+
[
14+
"@semantic-release/git",
15+
{
16+
"assets": ["package.json", "package-lock.json", "jsr.json"],
17+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
18+
}
19+
],
20+
[
21+
"@semantic-release/github",
22+
{
23+
"successComment": "✅ This PR is included in version ${nextRelease.version}",
24+
"failTitle": "The automated release is failing 🚨",
25+
"labels": ["release"]
26+
}
27+
]
28+
]
29+
}

example-audit-report.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"timestamp": "2025-10-29T11:07:49.864Z",
2+
"timestamp": "2025-10-29T11:10:37.132Z",
33
"total": 51,
44
"working": 51,
55
"partial": 0,

0 commit comments

Comments
 (0)