-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.config.js
63 lines (61 loc) · 2.25 KB
/
release.config.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
const config = {
// Define the branches where releases are allowed
branches: ['main', { name: 'release', prerelease: true }],
plugins: [
[
'@semantic-release/commit-analyzer', // Use the commit-analyzer plugin to analyze commit messages.
{
preset: 'conventionalcommits',
releaseRules: [
{ type: 'docs', scope: 'README', release: 'patch' }, // For 'docs' commits with scope 'README', release a patch version.
{ type: 'refactor', release: 'patch' }, // For 'refactor' commits, release a patch version.
{ type: 'style', release: 'patch' }, // For 'style' commits, release a patch version.
],
parserOpts: { noteKeywords: 'BREAKING' },
},
],
[
'@semantic-release/release-notes-generator', // Use the release-notes-generator plugin to generate release notes.
{
preset: 'conventionalcommits', // Configure it to use the conventional commits preset.
parserOpts: { noteKeywords: 'BREAKING' }, // Specify note keywords for breaking changes.
},
],
[
'@semantic-release/changelog', // Use the changelog plugin to manage changelog files.
{
changelogFile: 'docs/CHANGELOG.md', // Specify the location of the changelog file.
},
],
[
"@semantic-release/npm",
{
"npmPublish": false,
}
],
[
'@semantic-release/github', // Use the GitHub plugin to interact with GitHub repositories.
{
successComment: false, // Disable posting a success comment on GitHub.
releasedLabels: false, // Disable updating released labels on GitHub.
},
],
[
'semantic-release-slack-bot', // Use the semantic-release-slack-bot plugin for Slack notifications.
{
notifyOnSuccess: true, // Notify on successful releases.
notifyOnFail: true, // Notify on failed releases.
},
],
],
};
console.log('branch', process.env.CURRENT_BRANCH);
if (process.env.CURRENT_BRANCH === "main") {
config.plugins.push([
'@semantic-release/git', // Use the git plugin to commit and push changes to Git.
{
assets: ['docs/CHANGELOG.md', 'package.json'], // Specify assets to be included in the Git release commit.
},
]);
}
module.exports = config;