-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.config.cjs
154 lines (151 loc) · 6.25 KB
/
release.config.cjs
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* eslint-disable no-template-curly-in-string */
const path = require('path');
const util = require('util');
const fs = require('fs');
const readFileAsync = util.promisify(fs.readFile);
// the *.hbs template and partials should be passed as strings of contents
const template = readFileAsync(
path.resolve(__dirname, 'templates', 'release-notes.hbs'),
);
const commitTemplate = readFileAsync(
path.resolve(__dirname, 'templates', 'commit-template.hbs'),
);
let choreMessage = '';
if (process.env.GITHUB_ACTIONS) {
// CI IS SET
choreMessage = ':construction_worker: chore(release): ${nextRelease.version}';
} else {
// CI IS NOT SET
choreMessage =
':construction_worker: chore(release): ${nextRelease.version} [skip ci]';
}
module.exports = {
release: {
defaultBranch: 'main',
branches: ['main'],
},
plugins: [
[
'semantic-release-gitmoji',
{
// NOTE: These are categorized by the gitmojis.json found here
// https://raw.githubusercontent.com/carloscuesta/gitmoji/master/packages/gitmojis/src/gitmojis.json
releaseRules: {
major: [
':boom:', //Introduce breaking changes.
],
minor: [
':sparkles:', //Introduce new features.
],
patch: [
':zap:', //Improve performance.
':bug:', //Fix a bug.
':ambulance:', //Critical hotfix.
':lipstick:', //Add or update the UI and style files.
':lock:', //Fix security or privacy issues.
':arrow_down:', //Downgrade dependencies.
':arrow_up:', //Upgrade dependencies.
':pushpin:', //Pin dependencies to specific versions.
':chart_with_upwards_trend:', //Add or update analytics or track code.
':heavy_plus_sign:', //Add a dependency.
':heavy_minus_sign:', //Remove a dependency.
':wrench:', //Add or update configuration files.
':globe_with_meridians:', //Internationalization and localization.
':pencil2:', //Fix typos.
':rewind:', //Revert changes.
':package:', //Add or update compiled files or packages.
':alien:', //Update code due to external API changes.
':bento:', //Add or update assets.
':wheelchair:', //Improve accessibility.
':speech_balloon:', //Add or update text and literals.
':card_file_box:', //Perform database related changes.
':children_crossing:', //Improve user experience / usability.
':iphone:', //Work on responsive design.
':egg:', //Add or update an easter egg.
':alembic:', //Perform experiments.
':mag:', //Improve SEO.
':label:', //Add or update types.
':triangular_flag_on_post:', //Add, update, or remove feature flags.
':goal_net:', //Catch errors.
':dizzy:', //Add or update animations and transitions.
':wastebasket:', //Deprecate code that needs to be cleaned up.
':passport_control:', //Work on code related to authorization, roles and permissions.
':adhesive_bandage:', //Simple fix for a non-critical issue.
':necktie:', //Add or update business logic.
],
// LEFT OUT AS THESE ARE N/A
//':art:', //Improve structure / format of the code.
//':fire:', //Remove code or files.
//':memo:', //Add or update documentation.
//':rocket:', //Deploy stuff.
//':tada:', //Begin a project.
//':white_check_mark:', //Add, update, or pass tests.
//':closed_lock_with_key:', //Add or update secrets.
//':bookmark:', //Release / Version tags.
//':rotating_light:', //Fix compiler / linter warnings.
//':construction:', //Work in progress.
//':green_heart:', //Fix CI Build.
//':construction_worker:', //Add or update CI build system.
//':recycle:', //Refactor code.
//':hammer:', //Add or update development scripts.
//':poop:', //Write bad code that needs to be improved.
//':twisted_rightwards_arrows:', //Merge branches.
//':truck:', //Move or rename resources (e.g.: files, paths, routes).
//':page_facing_up:', //Add or update license.
//':bulb:', //Add or update comments in source code.
//':beers:', //Write code drunkenly.
//':loud_sound:', //Add or update logs.
//':mute:', //Remove logs.
//':busts_in_silhouette:', //Add or update contributor(s).
//':building_construction:', //Make architectural changes.
//':clown_face:', //Mock things.
//':see_no_evil:', //Add or update a .gitignore file.
//':camera_flash:', //Add or update snapshots.
//':seedling:', //Add or update seed files.
//':monocle_face:', //Data exploration/inspection.
//':coffin:', //Remove dead code.
//':test_tube:', //Add a failing test.
//':stethoscope:', //Add or update healthcheck.
//':bricks:', //Infrastructure related changes.
//':technologist:', //Improve developer experience.
//':money_with_wings:', //Add sponsorships or money related infrastructure.
//':thread:', //Add or update code related to multithreading or concurrency.
//':safety_vest:', //Add or update code related to validation.
},
releaseNotes: {
template,
partials: { commitTemplate },
issueResolution: {
template: '{baseUrl}/{owner}/{repo}/issues/{ref}',
baseUrl: 'https://github.com',
source: 'github.com',
removeFromCommit: false,
regex: /#\d+/g, // example matches: #2341 #8
},
},
},
],
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
changelogTitle: '# Changelog',
},
],
[
'@semantic-release/npm',
{
npmPublish: false,
},
],
[
'@semantic-release/git',
{
assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
message: `${choreMessage}\n\n\${nextRelease.notes}`,
},
],
'@semantic-release/github',
],
extends: ['semantic-release-config-gitmoji'],
};