-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.releaserc.js
73 lines (64 loc) · 2.29 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
const compareFunc = require('compare-func')
module.exports = {
branches: ["main"],
plugins: [
["@semantic-release/commit-analyzer", {
preset: "conventionalcommits",
releaseRules: [
{ type: "docs", release: "patch" },
{ type: "refactor", release: "patch" },
{ type: "style", release: "patch" },
{ type: "chore", release: "patch" }
]
}],
["@semantic-release/release-notes-generator", {
preset: "conventionalcommits",
presetConfig: {
types: [
{ type: "build", hidden: true },
{ type: "chore", scope: "deps", section: "📌 Dependencies" },
{ type: "chore", scope: "other", hidden: true },
{ type: "ci", hidden: true },
{ type: "docs", section: "🛠 Improvements" },
{ type: "feat", section: "✨ Features" },
{ type: "fix", section: "🐛 Enhancements + Bug Fixes" },
{ type: "perf", section: "🐛 Enhancements + Bug Fixes" },
{ type: "refactor", section: "🐛 Enhancements + Bug Fixes" },
{ type: "revert", section: "⚙️ Other" },
{ type: "style", section: "🛠 Improvements" },
{ type: "test", section: "🛠 Improvements" }
]
},
writerOpts: {
groupBy: "type",
commitGroupsSort: (a, b) => {
const alphaA = a.title.replace(/[^a-zA-Z]/gu, "");
const alphaB = b.title.replace(/[^a-zA-Z]/gu, "");
const commitGroupOrder = ['Features', 'EnhancementsBugFixes', 'Improvements', 'Other', 'Dependencies'];
const gRankA = commitGroupOrder.indexOf(alphaA);
const gRankB = commitGroupOrder.indexOf(alphaB);
return gRankA - gRankB;
},
commitsSort: ['scope', 'subject'],
noteGroupsSort: 'title',
notesSort: compareFunc
}
}],
["@semantic-release/changelog", {
changelogFile: "CHANGELOG.md",
changelogTitle: "# Changelog\n\n"
}],
["@semantic-release/exec", {
prepareCmd: `
set -e
echo \${nextRelease.version} > /tmp/released.version;
`
}],
["@semantic-release/git", {
assets: ["CHANGELOG.md"],
message: "chore(release): ${nextRelease.version} [skip ci]"
}],
"@semantic-release/github"
],
preset: "conventionalcommits"
};