forked from SingTown/react-native-webrtc-nitro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.config.cjs
More file actions
60 lines (58 loc) · 1.62 KB
/
release.config.cjs
File metadata and controls
60 lines (58 loc) · 1.62 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
const rules = [
{ type: 'feat', release: 'minor', title: '✨ Features' },
{ type: 'fix', release: 'patch', title: '🐛 Bug Fixes' },
{ type: 'perf', release: 'patch', title: '💨 Performance Improvements' },
{ type: 'refactor', release: 'patch', title: '🔄 Code Refactors' },
{ type: 'docs', release: 'patch', title: '📚 Documentation' },
{ type: 'chore', release: 'patch', title: '🛠️ Other changes' },
]
const sortMap = Object.fromEntries(
rules.map((rule, index) => [rule.title, index])
)
/**
* @type {import('semantic-release').GlobalConfig}
*/
module.exports = {
branches: ['main', { name: 'next', prerelease: 'next' }],
plugins: [
[
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
releaseRules: [
{ breaking: true, release: 'major' },
{ revert: true, release: 'patch' },
].concat(rules.map(({ type, release }) => ({ type, release }))),
},
],
[
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
presetConfig: {
types: rules.map(({ type, title }) => ({
type,
section: title,
})),
},
writerOpts: {
commitGroupsSort: (a, z) => sortMap[a.title] - sortMap[z.title],
},
},
],
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
},
],
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['package.json', 'CHANGELOG.md', 'example/package.json'],
},
],
],
}