Skip to content

Commit 0cc79d7

Browse files
committed
ci: add semantic-release for automated versioning and changelog
Add semantic-release with changelog generation and GitHub releases. No npm publish (private monorepo).
1 parent d80f059 commit 0cc79d7

File tree

4 files changed

+1703
-33
lines changed

4 files changed

+1703
-33
lines changed

.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+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
release:
14+
name: Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 22
28+
cache: pnpm
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Lint & Format
34+
run: pnpm ci:check
35+
36+
- name: Type Check
37+
run: pnpm type-check
38+
39+
- name: Tests
40+
run: pnpm test
41+
42+
- name: Build
43+
run: pnpm build
44+
45+
- name: Release
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: pnpm semantic-release

.releaserc.json

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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
"jscpd": "^4.0.7",
3939
"knip": "^5.81.0",
4040
"lint-staged": "^16.2.7",
41+
"semantic-release": "^24.2.6",
42+
"@semantic-release/changelog": "^6.0.3",
43+
"@semantic-release/git": "^10.0.1",
4144
"turbo": "latest"
4245
},
4346
"lint-staged": {

0 commit comments

Comments
 (0)