forked from algolia/instantsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ship.config.js
65 lines (64 loc) · 1.65 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
62
63
64
65
/* eslint-disable import/no-commonjs */
const fs = require('fs');
const path = require('path');
module.exports = {
shouldPrepare: ({ releaseType, commitNumbersPerType }) => {
const { fix = 0 } = commitNumbersPerType;
if (releaseType === 'patch' && fix === 0) {
return false;
}
return true;
},
versionUpdated: ({ version, dir }) => {
fs.writeFileSync(
path.resolve(dir, 'src', 'lib', 'version.ts'),
`export default '${version}';\n`
);
},
beforeCommitChanges: ({ exec }) => {
exec('yarn doctoc');
},
pullRequestTeamReviewers: ['instantsearch-for-websites'],
buildCommand: ({ version }) =>
`NODE_ENV=production VERSION=${version} yarn build`,
slack: {
// disable slack notification for `prepared` lifecycle.
// Ship.js will send slack message 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: 'Branch',
value: 'master',
short: true,
},
{
title: 'Commit',
value: `*<${latestCommitUrl}|${latestCommitHash}>*`,
short: true,
},
{
title: 'Version',
value: version,
short: true,
},
{
title: 'Release',
value: `${repoURL}/releases/tag/${tagName}`,
},
],
}),
},
};