Repository navigation
Expand file tree
/
Copy pathrelease.config.mjs
More file actions
58 lines (57 loc) · 2.25 KB
/
Copy pathrelease.config.mjs
File metadata and controls
58 lines (57 loc) · 2.25 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
// semantic-release: `staging` publishes release candidates (`x.y.z-rc.N`, npm dist-tag `rc`), and merging
// staging into `main` publishes the release (`latest`). See CONTRIBUTING.md#releases.
const stable = process.env.GITHUB_REF_NAME === 'main';
const preset = 'conventionalcommits';
export default {
branches: ['main', { name: 'staging', prerelease: 'rc', channel: 'rc' }],
tagFormat: 'v${version}',
plugins: [
[
'@semantic-release/commit-analyzer',
{
preset,
// Still 0.x: a breaking change is a minor release. Drop the first rule when stackmap reaches 1.0.
releaseRules: [
{ breaking: true, release: 'minor' },
{ revert: true, release: 'patch' },
{ type: 'feat', release: 'minor' },
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' },
],
},
],
['@semantic-release/release-notes-generator', { preset }],
[
'@semantic-release/exec',
{
// Pins the version, then packs with bun: its prepack builds, and it rewrites the `workspace:*` deps.
prepareCmd: 'node scripts/set-version.mjs ${nextRelease.version} && rm -rf .release && cd packages/cli && bun pm pack --destination ../../.release --quiet',
publishCmd: 'npm publish .release/*.tgz --provenance --access public --tag ${nextRelease.channel || "latest"}',
},
],
// Only a release commits its version back; release candidates live on npm alone, so staging and main never
// fight over the pinned version lines.
...(stable
? [
[
'@semantic-release/git',
{
// Exactly what set-version touches: the plugin force-adds, so a broad glob would sweep in ignored files.
assets: [
'bun.lock',
'README.md',
'packages/cli/package.json',
'packages/schema/src/schema.ts',
'packages/schema/stackmap.schema.json',
'skill/SKILL.md',
'skill/references/*.{md,json}',
'skill/examples/*.json',
],
message: 'chore(release): ${nextRelease.version} [skip ci]',
},
],
]
: []),
'@semantic-release/github',
],
};