-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.releaserc.js
More file actions
92 lines (89 loc) · 2.68 KB
/
Copy path.releaserc.js
File metadata and controls
92 lines (89 loc) · 2.68 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/**
* Handlebars partial for a single commit entry.
*
* Renders the subject line with an optional scope prefix and a commit link,
* then appends the commit body as an indented paragraph when present. This
* makes changelogs read as prose rather than bare commit subjects.
*
* The tilde (~) strips whitespace between Handlebars tags so the output
* does not accumulate extra blank lines from the template itself.
*/
const commitPartial = `\
*{{#if scope}} **{{scope}}:**{{~/if}} \
{{~#if subject}}{{subject}}{{else}}{{header}}{{/if}} \
{{~#if @root.linkReferences}} ([{{shortHash}}]({{commitUrlFormat}})){{else}} {{shortHash}}{{/if}}
{{#if body}}
{{body}}
{{/if}}`;
/** @type {import('semantic-release').GlobalConfig} */
export default {
branches: [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
{ name: "beta", prerelease: true },
{ name: "alpha", prerelease: true },
],
plugins: [
[
"@semantic-release/commit-analyzer",
{
preset: "conventionalcommits",
releaseRules: [
{ type: "feat", release: "minor" },
{ type: "fix", release: "patch" },
{ type: "perf", release: "patch" },
{ type: "revert", release: "patch" },
{ breaking: true, release: "major" },
],
},
],
[
"@semantic-release/release-notes-generator",
{
preset: "conventionalcommits",
presetConfig: {
types: [
{ type: "feat", section: "✨ Features", hidden: false },
{ type: "fix", section: "🐛 Bug Fixes", hidden: false },
{
type: "perf",
section: "⚡ Performance Improvements",
hidden: false,
},
{ type: "revert", section: "⏪ Reverts", hidden: false },
{ type: "docs", section: "📚 Documentation", hidden: false },
{ type: "refactor", section: "♻️ Refactoring", hidden: false },
{ type: "test", section: "✅ Tests", hidden: true },
{ type: "build", section: "📦 Build System", hidden: true },
{ type: "ci", section: "👷 CI", hidden: true },
{ type: "chore", section: "🔧 Maintenance", hidden: true },
],
},
writerOpts: { commitPartial },
},
],
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md",
changelogTitle:
"# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.",
},
],
"@semantic-release/npm",
[
"@semantic-release/github",
{
assets: [{ path: "CHANGELOG.md", label: "Changelog" }],
},
],
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md", "package.json", "yarn.lock"],
message:
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
},
],
],
};