Skip to content

Commit bbb4ac5

Browse files
committed
ci: add commitlint, pr title validation, and prerelease channel
1 parent 89f2494 commit bbb4ac5

File tree

6 files changed

+157
-6
lines changed

6 files changed

+157
-6
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ on:
55
branches: [main, v2.5]
66

77
jobs:
8+
lint-pr-title:
9+
name: Validate PR Title
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: oven-sh/setup-bun@v2
14+
- run: bun install
15+
- run: echo "${{ github.event.pull_request.title }}" | bunx commitlint --verbose
16+
817
test:
18+
name: Test
919
runs-on: ubuntu-latest
1020
steps:
1121
- uses: actions/checkout@v4

.github/workflows/publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ name: Publish
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, v2.5]
66

77
jobs:
88
publish:
9+
name: Release
910
runs-on: ubuntu-latest
1011
permissions:
1112
contents: write
@@ -14,6 +15,8 @@ jobs:
1415
id-token: write
1516
steps:
1617
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1720
- uses: oven-sh/setup-bun@v2
1821
- run: bun install
1922
- run: bun run lint

.releaserc.json

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,49 @@
11
{
2-
"branches": ["main"],
2+
"branches": [
3+
"main",
4+
{
5+
"name": "v2.5",
6+
"prerelease": "beta"
7+
}
8+
],
39
"plugins": [
410
[
511
"@semantic-release/commit-analyzer",
612
{
7-
"preset": "conventionalcommits"
13+
"preset": "conventionalcommits",
14+
"releaseRules": [
15+
{ "breaking": true, "release": "major" },
16+
{ "type": "feat", "release": "minor" },
17+
{ "type": "fix", "release": "patch" },
18+
{ "type": "perf", "release": "patch" },
19+
{ "type": "refactor", "release": "patch" },
20+
{ "type": "docs", "release": false },
21+
{ "type": "style", "release": false },
22+
{ "type": "test", "release": false },
23+
{ "type": "ci", "release": false },
24+
{ "type": "chore", "release": false }
25+
]
26+
}
27+
],
28+
[
29+
"@semantic-release/release-notes-generator",
30+
{
31+
"preset": "conventionalcommits",
32+
"presetConfig": {
33+
"types": [
34+
{ "type": "feat", "section": "Features" },
35+
{ "type": "fix", "section": "Bug Fixes" },
36+
{ "type": "perf", "section": "Performance" },
37+
{ "type": "refactor", "section": "Refactoring" },
38+
{ "type": "docs", "section": "Documentation", "hidden": true },
39+
{ "type": "style", "hidden": true },
40+
{ "type": "test", "hidden": true },
41+
{ "type": "ci", "hidden": true },
42+
{ "type": "chore", "hidden": true }
43+
]
44+
}
845
}
946
],
10-
"@semantic-release/release-notes-generator",
1147
"@semantic-release/changelog",
1248
"@semantic-release/npm",
1349
"@semantic-release/github",

0 commit comments

Comments
 (0)