-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.config.js
More file actions
68 lines (59 loc) · 2.28 KB
/
release.config.js
File metadata and controls
68 lines (59 loc) · 2.28 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
61
62
63
64
65
66
67
68
export default {
branches: ['main'],
plugins: [
// 1. Determine the next version number from commit history.
[
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
releaseRules: [
// Standard rules
{ type: 'feat', release: 'minor' },
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' },
// Custom rules for BREAKING CHANGE variations
{ breaking: true, release: 'major' },
// Additional patterns for major version bumps
{ type: 'feat', scope: 'breaking', release: 'major' },
{ type: 'fix', scope: 'breaking', release: 'major' },
{ type: 'refactor', scope: 'breaking', release: 'major' },
// Custom notes patterns that should trigger major release
{ type: '*', notes: { breaking: true }, release: 'major' },
],
parserOpts: {
noteKeywords: [
'BREAKING CHANGE',
'BREAKING CHANGES', // Allow plural
'BREAKING-CHANGE', // Allow hyphen
'BREAKING_CHANGE', // Allow underscore
],
},
},
],
// 2. Generate release notes content (text).
'@semantic-release/release-notes-generator',
// 3. Write the release notes content generated in step 2 to the Changelog file.
'@semantic-release/changelog',
// 4. Run prettier and build before committing.
[
'@semantic-release/exec',
{ prepareCmd: 'pnpm run fmt && pnpm run build && pnpm run test' },
],
// 4-a. Update the version field in package.json with the next version number.
// 4-b. Publish the package to npmjs.
// 4-c. Run `npm dist-tag` command to add a tag to the package published on npmjs.
'@semantic-release/npm',
// 5. Commit the changes of assets generated during the release flow to the repository.
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'package.json', 'pnpm-lock.yaml'],
message:
// eslint-disable-next-line no-template-curly-in-string
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
// 6. Create a GitHub Release using the release notes content generated in step 2.
'@semantic-release/github',
],
};