Skip to content

Commit 4a0bcef

Browse files
committed
feat: setup semantic-release
1 parent 097e9ef commit 4a0bcef

File tree

3 files changed

+65
-20
lines changed

3 files changed

+65
-20
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Conventional Commits Standards
2+
3+
All commits in this repository must follow the Conventional Commits specification. This ensures that our automated release pipeline can correctly calculate version bumps and generate changelogs.
4+
5+
## Format
6+
7+
`<type>(<scope>): <description>`
8+
9+
## Types
10+
11+
- `feat`: A new feature (triggers a MINOR version bump)
12+
- `fix`: A bug fix (triggers a PATCH version bump)
13+
- `docs`: Documentation only changes
14+
- `style`: Changes that do not affect the meaning of the code
15+
- `refactor`: A code change that neither fixes a bug nor adds a feature
16+
- `perf`: A code change that improves performance
17+
- `test`: Adding missing tests or correcting existing tests
18+
- `chore`: Changes to the build process or auxiliary tools and libraries

.releaserc.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* @type {import('semantic-release').GlobalConfig}
3+
*/
4+
module.exports = {
5+
branches: ['prod', { name: 'main', prerelease: 'rc' }],
6+
plugins: [
7+
[
8+
'@semantic-release/commit-analyzer',
9+
{
10+
preset: 'conventionalcommits',
11+
releaseRules: [
12+
{ type: 'docs', scope: 'README', release: 'patch' },
13+
{ type: 'refactor', release: 'patch' },
14+
{ type: 'style', release: 'patch' },
15+
{ type: 'chore', scope: 'release', release: false },
16+
],
17+
},
18+
],
19+
[
20+
'@semantic-release/release-notes-generator',
21+
{
22+
preset: 'conventionalcommits',
23+
presetConfig: {
24+
types: [
25+
{ type: 'feat', section: 'Features' },
26+
{ type: 'fix', section: 'Bug Fixes' },
27+
{ type: 'chore', section: 'Others' },
28+
{ type: 'docs', section: 'Documentation' },
29+
{ type: 'style', section: 'Styles' },
30+
{ type: 'refactor', section: 'Code Refactoring' },
31+
{ type: 'perf', section: 'Performance Improvements' },
32+
{ type: 'test', section: 'Tests' },
33+
],
34+
},
35+
},
36+
],
37+
'@semantic-release/npm',
38+
'@semantic-release/github',
39+
[
40+
'@semantic-release/git',
41+
{
42+
assets: ['package.json'],
43+
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
44+
},
45+
],
46+
],
47+
}

package.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,6 @@
1616
"scripts": {
1717
"release": "semantic-release"
1818
},
19-
"release": {
20-
"branches": [
21-
"prod"
22-
],
23-
"plugins": [
24-
"@semantic-release/commit-analyzer",
25-
"@semantic-release/release-notes-generator",
26-
"@semantic-release/npm",
27-
"@semantic-release/github",
28-
[
29-
"@semantic-release/git",
30-
{
31-
"assets": [
32-
"package.json"
33-
],
34-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
35-
}
36-
]
37-
]
38-
},
3919
"keywords": [
4020
"openai",
4121
"google",

0 commit comments

Comments
 (0)