-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.release-it.cjs
58 lines (55 loc) · 1.63 KB
/
.release-it.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
// CalVer date tags 0Y, 0M, 0W and 0D are not supported by "@release-it/bumper"
// and "@release-it/conventional-changelog".
// Reason: Those plugins support semver only.
// This file uses CommonJS because `cosmiconfig`.
const { readFileSync } = require('fs');
const {
commitGroupsSort,
} = require('./scripts/release-it/plugins/conventional-changelog/commit-groups-sort.cjs');
const { types } = require('./scripts/release-it/types.cjs');
const scriptsPath = './scripts/release-it';
const hooksPath = `${scriptsPath}/hooks`;
const pluginsPath = `${scriptsPath}/plugins`;
const templatesPath = `${scriptsPath}/templates`;
module.exports = {
git: {
// eslint-disable-next-line no-template-curly-in-string
commitMessage: 'chore: Release ${version}\n\n[skip ci]',
requireBranch: 'main',
},
github: {
release: true,
},
npm: false,
hooks: {
'before:conventional-changelog:beforeRelease': `bash ${hooksPath}/changelog/delete_header.sh`,
'after:conventional-changelog:beforeRelease': `bash ${hooksPath}/changelog/add_header.sh`,
},
plugins: {
'@release-it/bumper': {
in: {
file: 'VERSION',
type: 'text/plain',
},
out: [
{
file: 'VERSION',
type: 'text/plain',
},
],
},
[`${pluginsPath}/calver-bumper.js`]: {},
'@release-it/conventional-changelog': {
infile: 'CHANGELOG.md',
ignoreRecommendedBump: true,
preset: {
name: 'conventionalcommits',
types,
},
writerOpts: {
headerPartial: readFileSync(`${templatesPath}/header.hbs`, 'utf8'),
commitGroupsSort,
},
},
},
};