Skip to content

Commit d96f916

Browse files
author
Andrea Aramini, INI-MBM-BNC (EXT)
committed
🚀 deploy: fix
1 parent f96fd28 commit d96f916

File tree

2 files changed

+176
-179
lines changed

2 files changed

+176
-179
lines changed

release.config.cjs

-179
This file was deleted.

release.config.js

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/* eslint-disable no-template-curly-in-string */
2+
3+
import dateFormat from 'dateformat';
4+
import promisify from 'util';
5+
import readFile from 'fs';
6+
const readFileAsync = promisify(readFile);
7+
8+
// the *.hbs template and partials should be passed as strings of contents
9+
const template = readFileAsync('./build/default-template.hbs');
10+
const commitTemplate = readFileAsync('./build/commit-template.hbs');
11+
let choreMessage = '';
12+
if (process.env.GITHUB_ACTIONS) {
13+
// CI IS SET
14+
choreMessage = ':construction_worker: chore(release): ${nextRelease.version}';
15+
} else {
16+
// CI IS NOT SET
17+
choreMessage =
18+
':construction_worker: chore(release): ${nextRelease.version} [skip ci]';
19+
}
20+
21+
export const release = {
22+
defaultBranch: 'main',
23+
branches: [
24+
'+([0-9])?(.{+([0-9]),x}).x',
25+
'main',
26+
'next',
27+
'next-major',
28+
{
29+
name: 'beta',
30+
prerelease: true,
31+
},
32+
{
33+
name: 'alpha',
34+
prerelease: true,
35+
},
36+
],
37+
};
38+
export const plugins = [
39+
[
40+
'semantic-release-gitmoji',
41+
{
42+
// NOTE: These are categorized by the gitmojis.json found here
43+
// https://raw.githubusercontent.com/carloscuesta/gitmoji/master/packages/gitmojis/src/gitmojis.json
44+
releaseRules: {
45+
major: [
46+
':boom:', //Introduce breaking changes.
47+
],
48+
minor: [
49+
':sparkles:', //Introduce new features.
50+
],
51+
patch: [
52+
':zap:', //Improve performance.
53+
':bug:', //Fix a bug.
54+
':ambulance:', //Critical hotfix.
55+
':lipstick:', //Add or update the UI and style files.
56+
':lock:', //Fix security or privacy issues.
57+
':arrow_down:', //Downgrade dependencies.
58+
':arrow_up:', //Upgrade dependencies.
59+
':pushpin:', //Pin dependencies to specific versions.
60+
':chart_with_upwards_trend:', //Add or update analytics or track code.
61+
':heavy_plus_sign:', //Add a dependency.
62+
':heavy_minus_sign:', //Remove a dependency.
63+
':wrench:', //Add or update configuration files.
64+
':globe_with_meridians:', //Internationalization and localization.
65+
':pencil2:', //Fix typos.
66+
':rewind:', //Revert changes.
67+
':package:', //Add or update compiled files or packages.
68+
':alien:', //Update code due to external API changes.
69+
':bento:', //Add or update assets.
70+
':wheelchair:', //Improve accessibility.
71+
':speech_balloon:', //Add or update text and literals.
72+
':card_file_box:', //Perform database related changes.
73+
':children_crossing:', //Improve user experience / usability.
74+
':iphone:', //Work on responsive design.
75+
':egg:', //Add or update an easter egg.
76+
':alembic:', //Perform experiments.
77+
':mag:', //Improve SEO.
78+
':label:', //Add or update types.
79+
':triangular_flag_on_post:', //Add, update, or remove feature flags.
80+
':goal_net:', //Catch errors.
81+
':dizzy:', //Add or update animations and transitions.
82+
':wastebasket:', //Deprecate code that needs to be cleaned up.
83+
':passport_control:', //Work on code related to authorization, roles and permissions.
84+
':adhesive_bandage:', //Simple fix for a non-critical issue.
85+
':necktie:', //Add or update business logic.
86+
],
87+
// LEFT OUT AS THESE ARE N/A
88+
//':art:', //Improve structure / format of the code.
89+
//':fire:', //Remove code or files.
90+
//':memo:', //Add or update documentation.
91+
//':rocket:', //Deploy stuff.
92+
//':tada:', //Begin a project.
93+
//':white_check_mark:', //Add, update, or pass tests.
94+
//':closed_lock_with_key:', //Add or update secrets.
95+
//':bookmark:', //Release / Version tags.
96+
//':rotating_light:', //Fix compiler / linter warnings.
97+
//':construction:', //Work in progress.
98+
//':green_heart:', //Fix CI Build.
99+
//':construction_worker:', //Add or update CI build system.
100+
//':recycle:', //Refactor code.
101+
//':hammer:', //Add or update development scripts.
102+
//':poop:', //Write bad code that needs to be improved.
103+
//':twisted_rightwards_arrows:', //Merge branches.
104+
//':truck:', //Move or rename resources (e.g.: files, paths, routes).
105+
//':page_facing_up:', //Add or update license.
106+
//':bulb:', //Add or update comments in source code.
107+
//':beers:', //Write code drunkenly.
108+
//':loud_sound:', //Add or update logs.
109+
//':mute:', //Remove logs.
110+
//':busts_in_silhouette:', //Add or update contributor(s).
111+
//':building_construction:', //Make architectural changes.
112+
//':clown_face:', //Mock things.
113+
//':see_no_evil:', //Add or update a .gitignore file.
114+
//':camera_flash:', //Add or update snapshots.
115+
//':seedling:', //Add or update seed files.
116+
//':monocle_face:', //Data exploration/inspection.
117+
//':coffin:', //Remove dead code.
118+
//':test_tube:', //Add a failing test.
119+
//':stethoscope:', //Add or update healthcheck.
120+
//':bricks:', //Infrastructure related changes.
121+
//':technologist:', //Improve developer experience.
122+
//':money_with_wings:', //Add sponsorships or money related infrastructure.
123+
//':thread:', //Add or update code related to multithreading or concurrency.
124+
//':safety_vest:', //Add or update code related to validation.
125+
},
126+
releaseNotes: {
127+
template,
128+
partials: { commitTemplate },
129+
helpers: {
130+
datetime(format = 'UTC:yyyy-mm-dd') {
131+
return dateFormat(new Date(), format);
132+
},
133+
},
134+
issueResolution: {
135+
template: '{baseUrl}/{owner}/{repo}/issues/{ref}',
136+
baseUrl: 'https://github.com',
137+
source: 'github.com',
138+
removeFromCommit: false,
139+
regex: /#\d+/g, // example matches: #2341 #8
140+
},
141+
},
142+
},
143+
],
144+
[
145+
'@semantic-release/changelog',
146+
{
147+
changelogFile: 'CHANGELOG.md',
148+
changelogTitle: '# Changelog',
149+
},
150+
],
151+
[
152+
'@semantic-release/npm',
153+
{
154+
npmPublish: false,
155+
tarballDir: 'dist',
156+
},
157+
],
158+
[
159+
'@semantic-release/git',
160+
{
161+
assets: ['package.json', 'CHANGELOG.md'],
162+
message: `${choreMessage}\n\n\${nextRelease.notes}`,
163+
// message: choreMessage,
164+
},
165+
],
166+
[
167+
'@semantic-release/github',
168+
{
169+
assets: [
170+
{
171+
path: 'dist/**',
172+
},
173+
],
174+
},
175+
],
176+
];

0 commit comments

Comments
 (0)