-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.releaserc.js
More file actions
78 lines (70 loc) · 1.99 KB
/
Copy path.releaserc.js
File metadata and controls
78 lines (70 loc) · 1.99 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
module.exports = {
branches: [
// main 分支:稳定版本 (v1.0.0)
'main',
// beta 分支:测试版本 (v1.0.0-beta.1)
{ name: 'beta', prerelease: true },
// alpha 分支:开发版本 (v1.0.0-alpha.1)
{ name: 'alpha', prerelease: true }
],
plugins: [
[
'@semantic-release/commit-analyzer',
{
preset: 'angular',
releaseRules: [
// 标准 semantic-release 规则 - 只有这些会触发版本发布
{ type: 'feat', release: 'minor' },
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' }
// 以下类型不会触发版本发布,避免不必要的 release
// { type: 'refactor', release: 'patch' },
// { type: 'style', release: 'patch' },
// { type: 'docs', release: 'patch' },
// { type: 'test', release: 'patch' },
// { type: 'build', release: 'patch' },
// { type: 'ci', release: 'patch' },
// { type: 'chore', release: 'patch' }
]
}
],
'@semantic-release/release-notes-generator',
// 更新 changelog 文件
['@semantic-release/changelog', { changelogFile: 'CHANGELOG.md' }],
// bump package.json 版本号,但不发布到 npm
[
'@semantic-release/npm',
{
npmPublish: false
}
],
// 提交回仓库
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'package.json'],
message: 'chore(release): ${nextRelease.version}\n\n${nextRelease.notes}'
}
],
// 创建 Release 并上传构建产物
[
'@semantic-release/github',
{
assets: [
// Windows 产物
'dist/*.exe',
'dist/*.zip',
// macOS 产物
'dist/*.dmg',
// Linux 产物
'dist/*.AppImage',
'dist/*.deb',
// 自动更新文件
'dist/*.yml',
'dist/*.yaml',
'dist/*.blockmap'
]
}
]
]
}