-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrelease.config.js
More file actions
65 lines (59 loc) · 1.56 KB
/
release.config.js
File metadata and controls
65 lines (59 loc) · 1.56 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
const { execSync } = require('child_process');
const MAIN_BRANCH = 'main';
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
.toString()
.replace('\n', '');
const branchSha = execSync('git rev-parse --short HEAD')
.toString()
.replace('\n', '');
const isMainBranch = branchName === MAIN_BRANCH;
const githubBranchConfig = isMainBranch
? {}
: {
successComment: `
This PR is part of this prerelease version for testing: \${nextRelease.version}
You can test it by using:
\`\`\`bash
npm install react-html-element@\${nextRelease.version}
\`\`\`
`,
};
const extraPlugins = isMainBranch
? [
[
'@semantic-release/git',
{
message:
'Docs: ${nextRelease.version} [skip ci]\n\n${nextRelease.note}',
assets: [
'CHANGELOG.md',
'package.json',
'package-lock.json',
'npm-shrinkwrap.json',
],
},
],
]
: [];
module.exports = {
repositoryUrl: 'git@github.com:im-open/react-html-element.git',
branches: [
{ name: 'main' },
{ name: 'react-17', channel: 'react-17', prerelease: 'react-17' },
{ name: 'react-16', channel: 'react-16' },
{
name: '*',
channel: 'development',
prerelease: `\${name}-${branchSha}`,
},
],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
['@semantic-release/github', { ...githubBranchConfig }],
...extraPlugins,
],
preset: 'eslint',
};