Repository navigation
Expand file tree
/
Copy pathrelease.config.js
More file actions
63 lines (61 loc) · 1.77 KB
/
Copy pathrelease.config.js
File metadata and controls
63 lines (61 loc) · 1.77 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
import fs from 'node:fs';
const DRY_RUN = false;
const packageFile = JSON.parse(fs.readFileSync(`${process.cwd()}/package.json`));
const unscopedName = packageFile.name.split('/').pop();
const scope = unscopedName === 'cradle' ? 'cli' : unscopedName;
export default {
dryRun: DRY_RUN,
tagFormat: `${unscopedName}-v\${version}`,
branches: ['main'],
plugins: [
[
'@semantic-release/commit-analyzer',
{
releaseRules: [
{ breaking: true, release: false },
{ type: 'feat', release: false },
{ type: 'fix', release: false },
{ type: 'chore', release: false },
{ breaking: true, scope, release: 'major' },
{ type: 'feat', scope, release: 'minor' },
{ type: 'fix', scope, release: 'patch' }
]
}
],
[
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
presetConfig: {
ignoreCommits: `^(?![^]*\\(${scope}\\))(?![^]*\\[${scope}\\]).*$`
}
}
],
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md'
}
],
[
'@semantic-release/exec',
{
prepareCmd: 'bun pm pkg set version=${nextRelease.version} && bun pm pack',
publishCmd: `npm publish ./*.tgz --registry=https://registry.npmjs.org ${DRY_RUN ? '--dry-run' : ''} --access=public`
}
],
[
'@semantic-release/git',
{
assets: ['package.json', 'CHANGELOG.md'],
message: `chore(release): ${unscopedName}` + '-v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}
],
[
'@semantic-release/github',
{
successComment: '🎉 This issue has been resolved in version ${nextRelease.version} 🎉'
}
]
]
};