-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.config.js
88 lines (80 loc) · 2.64 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
"use strict";
const pkg = require("./package.json");
const CHANGELOG_HEADER = `# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), enforced with [semantic-release](https://github.com/semantic-release/semantic-release).
`;
// Inspired by the Danger postfix.
// See https://github.com/danger/danger-js/blob/a6e6b6601a796c2eb0181134a46ffaad0c307529/source/runner/templates/githubIssueTemplate.ts#L69.
const COMMENT_POSTFIX = `<p align="right">
Generated by :package::rocket: <a href="https://github.com/semantic-release/semantic-release">semantic-release</a>
</p>`;
const SUCCESS_COMMENT = `:tada: This \${issue.pull_request ? 'pull request is included' : 'issue is fixed'} in v\${nextRelease.version}, available on npm: [${pkg.name}@\${nextRelease.version}](https://www.npmjs.com/package/${pkg.name}).
${COMMENT_POSTFIX}
`;
/**
* See:
* https://semantic-release.gitbook.io/semantic-release/
* https://github.com/semantic-release/npm
* https://github.com/semantic-release/github
* https://github.com/semantic-release/git
* https://github.com/semantic-release/release-notes-generator
* https://github.com/semantic-release/commit-analyzer
* https://github.com/semantic-release/changelog
*/
module.exports = {
branches: "main",
tagFormat: "v${version}",
npmPublish: true,
tarballDir: "dist",
assets: "dist/*.tgz",
verifyConditions: [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github",
],
analyzeCommits: {
preset: "angular",
},
verifyRelease: [],
generateNotes: ["@semantic-release/release-notes-generator"],
prepare: [
{
path: "@semantic-release/changelog",
changelogFile: "CHANGELOG.md",
changelogTitle: CHANGELOG_HEADER,
},
{
path: "@semantic-release/exec",
cmd:
"npm run build:docs && prettier --write README.md CHANGELOG.md && rm -rf .git/hooks",
},
"@semantic-release/npm",
{
path: "@semantic-release/git",
message:
"chore(release): v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
assets: [
"README.md",
"CHANGELOG.md",
"package.json",
"package-lock.json",
],
},
],
publish: [
"@semantic-release/npm",
{
path: "@semantic-release/github",
assets: ["dist/*.tgz"],
},
],
success: [
{
path: "@semantic-release/github",
successComment: SUCCESS_COMMENT,
},
],
fail: ["@semantic-release/github"],
};