-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.config.cjs
94 lines (85 loc) · 2.8 KB
/
release.config.cjs
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
/**
* @type {import('semantic-release').GlobalConfig}
*/
module.exports = {
branches: ['main', { name: 'beta', channel: 'beta', prerelease: true }],
plugins: [
// Run in order:
// 1. Analyze commits to determine release type
[
'@semantic-release/commit-analyzer',
{
preset: 'angular',
releaseRules: [
{ type: 'feature', release: 'minor'},
{ type: 'docs', message: '*README*', release: 'patch' },
{ type: 'refactor', release: 'patch' },
{ type: 'style', release: 'patch' },
{ type: 'chore', release: 'patch' },
],
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
},
},
],
// 2. Generate release notes
[
'@semantic-release/release-notes-generator',
{
preset: 'angular',
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
},
writerOpts: {
commitsSort: ['subject', 'scope'],
},
presetConfig: {
types: [
{ type: 'feat', section: 'Features' },
{ type: 'feature', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'hotfix', section: 'Bug Fixes' },
{ type: 'docs', section: 'Docs' },
{ type: 'refactor', section: 'Refactoring' },
{ type: 'perf', section: 'Performance Improvements' },
{ type: 'ci', section: 'CI/CD Changes' },
{ type: 'test', section: 'Tests' },
],
},
},
],
// 3. Update CHANGELOG (must be called before /npm)
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
},
],
// 4. Publish to npm (must be called after /changelog and before /git)
'@semantic-release/npm',
// 5. Publish to GH
'@semantic-release/github',
/* TODO: Use either of the below strategies to raise PR against `main` or commit directly to `main`
*** */
// 6. Update version with new release PR raised against main (in lieu of direct commit for now)
// If we're going to use this, it will require a shim. See errors in console.
// [
// "semantic-release-github-pullrequest", {
// "assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
// "baseRef": "main",
// "branch": 'semantic-release-pr<%= nextRelease.version %>',
// "pullRequestTitle": "chore(release) <%= nextRelease.version %>",
// }
// ]
// TODO: Fix token
// // 6. Update version with new release commit (must be called after /changelog and /npm)
// [
// '@semantic-release/git',
// {
// assets: ['docs', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'],
// message:
// "chore(release) <%= nextRelease.version %> - <%= new Date().toLocaleDateString('en-US', {year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }) %> [skip ci]\n\n<%= nextRelease.notes %> ",
// },
// ],
],
};