forked from defendicon/POS-Awesome-V15
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrelease.config.js
More file actions
103 lines (100 loc) · 2.87 KB
/
release.config.js
File metadata and controls
103 lines (100 loc) · 2.87 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
93
94
95
96
97
98
99
100
101
102
103
/* eslint-env node */
/* global module */
const dateFormatter = new Intl.DateTimeFormat("en-US", {
year: "numeric",
month: "long",
day: "numeric",
});
module.exports = {
branches: ["develop"],
tagFormat: "${version}",
repositoryUrl: "https://github.com/defendicon/POS-Awesome-V15.git",
plugins: [
"@semantic-release/commit-analyzer",
[
"@semantic-release/release-notes-generator",
{
preset: "conventionalcommits",
writerOpts: {
headerPartial: "Release {{version}} — {{date}}",
commitPartial: "- {{subject}} {{#if scope}}({{scope}}){{/if}}\n",
groupBy: "section",
commitGroupsSort: (a, b) => {
const order = [
"✨ Features",
"🐞 Bug Fixes",
"⚡ Performance",
"📝 Docs",
"🧰 Maintenance",
];
return order.indexOf(a.title) - order.indexOf(b.title);
},
transform: (commit) => {
const typeMap = {
feat: "✨ Features",
fix: "🐞 Bug Fixes",
perf: "⚡ Performance",
docs: "📝 Docs",
refactor: "🧰 Maintenance",
chore: "🧰 Maintenance",
ci: "🧰 Maintenance",
build: "🧰 Maintenance",
};
const section = typeMap[commit.type];
if (!section) return;
const subject = commit.subject
? commit.subject.replace(/\(#\d+\)/g, "").trim()
: undefined;
return {
...commit,
section,
...(subject && { subject }),
};
},
finalizeContext: (context) => {
const date = new Date(context.date);
const formattedDate = dateFormatter.format(date);
return {
...context,
date: formattedDate,
};
},
mainTemplate:
"{{> header}}\n\n{{#each commitGroups}}\n### {{title}}\n{{#each commits}}{{> commit root=@root}}{{/each}}_Total: {{commits.length}} changes_\n\n{{/each}}{{#if noteGroups}}\n{{#each noteGroups}}\n### {{title}}\n{{#each notes}}\n- {{text}}\n{{/each}}\n{{/each}}\n{{/if}}\n— Changelog auto-generated by semantic-release. Thanks to all contributors! 🙌\n",
},
},
],
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md",
changelogTitle: "# Changelog\n\nAll notable changes.",
},
],
[
"@semantic-release/exec",
{
prepareCmd:
"python scripts/update_version.py ${nextRelease.version} && yarn build && yarn verify:build && yarn electron:smoke && yarn electron:build:win && yarn electron:smoke --require-artifact",
},
],
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md", "package.json", "yarn.lock", "posawesome/__init__.py"],
message:
"Release: ${nextRelease.version} — ${new Date().toISOString().slice(0, 10)}\n\n${nextRelease.notes}\n",
},
],
[
"@semantic-release/github",
{
assets: [
"dist-electron/*.exe",
"dist-electron/*.blockmap",
"posawesome/public/dist/js/checksums.sha256",
],
},
],
],
};