-
Notifications
You must be signed in to change notification settings - Fork 0
/
.releaserc.js
99 lines (99 loc) · 2.53 KB
/
.releaserc.js
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
90
91
92
93
94
95
96
97
98
99
module.exports = {
branches: ['master'], // 指定在哪个分支下要执行发布操作
plugins: [
[
'@semantic-release/commit-analyzer',
{
"releaseRules": [
{ breaking: true, release: "major" },
{ revert: true, release: "patch" },
{ type: "feat", release: "minor" },
{ type: "fix", release: "patch" },
{ type: "perf", release: "patch" },
{ type: "refactor", release: "patch" },
{ type: "test", release: "patch" },
{ type: "revert", release: "patch" }
]
}
], // 解析 commit 信息,默认就是 Angular 规范
[
'@semantic-release/release-notes-generator',
{
preset: "conventionalcommits",
presetConfig: {
types: [{
type: "feat",
section: "Features",
hidden: false
},
{
type: "fix",
section: "Bug Fixes",
hidden: false
},
{
type: "perf",
section: "Performance",
hidden: false
},
{
type: "refactor",
section: "Refactor",
hidden: false
},
{
type: "test",
section: "Tests",
hidden: false
},
{
type: "revert",
section: "Revert",
hidden: false
},
{
type: "docs",
section: "Docs",
hidden: true
},
{
type: "style",
section: "Styles",
hidden: true
},
{
type: "build",
section: "Build",
hidden: true
},
{
type: "ci",
section: "CI/CD",
hidden: true
}
]
}
}
],
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md' // 把发布日志写入该文件
}
],
[
'@semantic-release/npm',
// {
// npmPublish: false
// }
],
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'package.json'], // 前面说到日志记录和版本好是新增修改的,需要 push 回 Git
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}