-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrelease.config.mjs
More file actions
89 lines (82 loc) · 2.24 KB
/
release.config.mjs
File metadata and controls
89 lines (82 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
* Semantic Release Configuration
*
* Automates versioning and publishing based on conventional commits.
* Publishes to npm registry and GitHub Container Registry (Docker).
*
* @see https://semantic-release.gitbook.io/
* @type {import('semantic-release').GlobalConfig}
*/
export default {
branches: ['main'],
tagFormat: 'v${version}',
plugins: [
// 1. Analyze commits to determine version bump
[
'@semantic-release/commit-analyzer',
{
preset: 'angular',
releaseRules: [
{ type: 'feat', release: 'minor' },
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' },
{ type: 'revert', release: 'patch' },
{ type: 'docs', release: false },
{ type: 'style', release: false },
{ type: 'refactor', release: 'patch' },
{ type: 'test', release: false },
{ type: 'build', release: false },
{ type: 'ci', release: false },
{ type: 'chore', release: false },
],
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
},
},
],
// 2. Generate release notes from commits
[
'@semantic-release/release-notes-generator',
{
preset: 'angular',
writerOpts: {
commitsSort: ['subject', 'scope'],
},
},
],
// 3. Update CHANGELOG.md
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
},
],
// 4. Publish to npm registry
'@semantic-release/npm',
// 5. Create GitHub release (Docker handled by CI workflow with caching)
[
'@semantic-release/github',
{
assets: [{ path: 'CHANGELOG.md', label: 'Changelog' }],
successComment: false,
failComment: false,
},
],
// 6. Commit updated files back to repo
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'package.json', 'pnpm-lock.yaml'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
// 7. Notify Slack on release
[
'@timebyping/semantic-release-slack-bot',
{
notifyOnSuccess: true,
notifyOnFail: true,
},
],
],
};