Skip to content

Commit 4210395

Browse files
saikrishna321claude
andcommitted
fix: add semantic-release for automated versioning and npm publishing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ab8d21a commit 4210395

File tree

4 files changed

+6559
-307
lines changed

4 files changed

+6559
-307
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
id-token: write
13+
14+
jobs:
15+
release:
16+
name: Semantic Release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '22'
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Install dependencies
30+
run: npm install --no-package-lock
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Semantic Release
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
run: npx semantic-release

.releaserc.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
[
5+
"@semantic-release/commit-analyzer",
6+
{
7+
"preset": "conventionalcommits",
8+
"releaseRules": [
9+
{ "type": "feat", "release": "minor" },
10+
{ "type": "fix", "release": "patch" },
11+
{ "type": "perf", "release": "patch" },
12+
{ "type": "revert", "release": "patch" },
13+
{ "type": "docs", "release": false },
14+
{ "type": "style", "release": false },
15+
{ "type": "chore", "release": false },
16+
{ "type": "refactor", "release": "patch" },
17+
{ "type": "test", "release": false },
18+
{ "type": "build", "release": false },
19+
{ "type": "ci", "release": false }
20+
]
21+
}
22+
],
23+
[
24+
"@semantic-release/release-notes-generator",
25+
{
26+
"preset": "conventionalcommits",
27+
"presetConfig": {
28+
"types": [
29+
{ "type": "feat", "section": "Features" },
30+
{ "type": "fix", "section": "Bug Fixes" },
31+
{ "type": "perf", "section": "Performance Improvements" },
32+
{ "type": "revert", "section": "Reverts" },
33+
{ "type": "refactor", "section": "Code Refactoring" },
34+
{ "type": "docs", "section": "Documentation", "hidden": true },
35+
{ "type": "style", "section": "Styles", "hidden": true },
36+
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true },
37+
{ "type": "test", "section": "Tests", "hidden": true },
38+
{ "type": "build", "section": "Build System", "hidden": true },
39+
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
40+
]
41+
}
42+
}
43+
],
44+
[
45+
"@semantic-release/changelog",
46+
{
47+
"changelogFile": "CHANGELOG.md"
48+
}
49+
],
50+
"@semantic-release/npm",
51+
[
52+
"@semantic-release/git",
53+
{
54+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
55+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
56+
}
57+
],
58+
[
59+
"@semantic-release/github",
60+
{
61+
"assets": []
62+
}
63+
]
64+
]
65+
}

0 commit comments

Comments
 (0)