-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathrelease.config.js
More file actions
48 lines (46 loc) · 1.6 KB
/
Copy pathrelease.config.js
File metadata and controls
48 lines (46 loc) · 1.6 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
// Maintenance branches (release/vX.Y) are added dynamically so semantic-release
// accepts whichever branch the workflow is triggered against, without needing
// to hardcode every future maintenance branch in advance.
const branch = process.env.GITHUB_REF_NAME || 'main'
const maintenanceMatch = branch.match(/^release\/v(\d+)\.(\d+)$/)
const branches = ['main']
if (maintenanceMatch) {
const [, major, minor] = maintenanceMatch
branches.push({
name: branch,
range: `${major}.${minor}.x`,
channel: 'maintenance',
prerelease: false
})
}
module.exports = {
branches,
tagFormat: 'v${version}',
plugins: [
[
'@semantic-release/commit-analyzer',
{
// Every conventional commit type triggers at least a patch so that
// running "Create Release" always produces a new version, even if the
// branch contains only chore/docs/ci commits.
releaseRules: [
{ breaking: true, release: 'major' },
{ revert: true, release: 'patch' },
{ type: 'feat', release: 'minor' },
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' },
{ type: 'revert', release: 'patch' },
{ type: 'chore', release: 'patch' },
{ type: 'docs', release: 'patch' },
{ type: 'style', release: 'patch' },
{ type: 'refactor', release: 'patch' },
{ type: 'test', release: 'patch' },
{ type: 'build', release: 'patch' },
{ type: 'ci', release: 'patch' }
]
}
],
'@semantic-release/release-notes-generator',
'@semantic-release/github'
]
}