forked from NerdWalletOSS/shepherd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.releaserc.js
58 lines (53 loc) · 1.67 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
'use strict';
/* The releaseConfig object drives configuration across 5 semantic-release plugins. For more details on the
plugin options and overides used see:
- @semantic-release/commit-analyzer: https://github.com/semantic-release/commit-analyzer
- @semantic-release/release-notes-generator: https://github.com/semantic-release/release-notes-generator
- @semantic-release/changelog: https://github.com/semantic-release/changelog
- @semantic-release/npm: https://github.com/semantic-release/npm#semantic-releasenpm
- @semantic-release/git: https://github.com/semantic-release/git
- @semantic-release/github: https://github.com/semantic-release/github
*/
function compileReleaseRules(listOfTypes, release = 'patch') {
return listOfTypes.map((type) => ({
type,
release,
}));
}
const typesForPatch = ['docs', 'style', 'refactor', 'perf'];
const typesForMinor = ['feat'];
const parserOpts = {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
};
const releaseConfig = {
branches: ['master'],
plugins: [
[
'@semantic-release/commit-analyzer',
{
releaseRules: [
...compileReleaseRules(typesForPatch),
...compileReleaseRules(typesForMinor, 'minor'),
],
parserOpts,
},
],
[
'@semantic-release/release-notes-generator',
{
parserOpts,
},
],
'@semantic-release/npm',
'@semantic-release/changelog',
[
'@semantic-release/git',
{
assets: ['package.json', 'CHANGELOG.md'],
message: 'chore(release): ${nextRelease.version} \n\n${nextRelease.notes}',
},
],
'@semantic-release/github',
],
};
module.exports = releaseConfig;