This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
/
ship.config.js
61 lines (60 loc) · 1.62 KB
/
ship.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
/* eslint-disable import/no-commonjs */
const fs = require('fs');
const path = require('path');
module.exports = {
mergeStrategy: { toSameBranch: ['master'] },
shouldPrepare: ({ releaseType, commitNumbersPerType }) => {
const { fix = 0 } = commitNumbersPerType;
if (releaseType === 'patch' && fix === 0) {
return false;
}
return true;
},
getTagName: ({ version }) => version,
versionUpdated: ({ version, dir }) => {
fs.writeFileSync(
path.resolve(dir, 'src', 'version.ts'),
`export const VERSION = '${version}';\n`
);
},
pullRequestTeamReviewers: ['frontend-experiences-web'],
buildCommand: ({ version }) => `VERSION=${version} yarn build`,
beforePublish: ({ exec }) => {
exec('cp CHANGELOG.md dist');
},
publishCommand: ({ defaultCommand }) => `cd dist && ${defaultCommand}`,
slack: {
// We send Slack messages only for `releaseSuccess`.
prepared: null,
releaseSuccess: ({
appName,
version,
tagName,
latestCommitHash,
latestCommitUrl,
repoURL,
}) => ({
pretext: [
`:tada: Successfully released *${appName}@${version}*`,
'',
`Make sure to run \`yarn run release-templates\` in \`create-instantsearch-app\`.`,
].join('\n'),
fields: [
{
title: 'Commit',
value: `*<${latestCommitUrl}|${latestCommitHash}>*`,
short: true,
},
{
title: 'Version',
value: version,
short: true,
},
{
title: 'Release',
value: `${repoURL}/releases/tag/${tagName}`,
},
],
}),
},
};