-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.config.js
65 lines (63 loc) · 1.66 KB
/
release.config.js
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
const { readFile } = require("fs/promises");
const { join } = require("path");
const dayjs = require("dayjs");
// release notes templates
const TEMPLATE_DIR =
"node_modules/semantic-release-gitmoji/lib/assets/templates";
const template = readFile(join(TEMPLATE_DIR, "default-template.hbs"));
const commitTemplate = readFile(join(TEMPLATE_DIR, "commit-template.hbs"));
module.exports = {
branches: ["main"],
plugins: [
// analyze commits to determine next release
[
"semantic-release-gitmoji",
{
releaseRules: {
major: [":boom:"],
minor: [":sparkles:"],
patch: [":bug:"],
},
releaseNotes: {
template,
partials: { commitTemplate },
helpers: {
datetime: () => dayjs(new Date()).format("DD MMM YYYY"),
},
issueResolution: {
template: "{baseUrl}/{owner}/{repo}/issues/{ref}",
baseUrl: "https://github.com",
source: "github.com",
removeFromCommit: false,
regex: /#\d+/g,
},
},
},
],
// output the release notes to the changelog
[
"@semantic-release/changelog",
{
changelogFile: "./CHANGELOG.md",
},
],
// update the version field
[
"@semantic-release/npm",
{
npmPublish: false,
},
],
// tag the release in github
"@semantic-release/github",
// commit the release assets
[
"@semantic-release/git",
{
message:
"🔖 `${nextRelease.gitTag}` [skip ci] \n\n${nextRelease.notes}",
assets: ["package.json", "CHANGELOG.md"],
},
],
],
};