forked from laurent22/joplin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (36 loc) · 1.6 KB
/
gulpfile.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
const gulp = require('gulp');
const utils = require('./packages/tools/gulp/utils');
const tasks = {
updateIgnoredTypeScriptBuild: require('./packages/tools/gulp/tasks/updateIgnoredTypeScriptBuild'),
buildCommandIndex: require('./packages/tools/gulp/tasks/buildCommandIndex'),
completePublishAll: {
fn: async () => {
await utils.execCommandVerbose('git', ['add', '-A']);
await utils.execCommandVerbose('git', ['commit', '-m', 'Releasing sub-packages']);
// Lerna does some unnecessary auth check that doesn't work with
// automation tokens, thus the --no-verify-access. Automation token
// is still used for access when publishing even with this flag
// (publishing would fail otherwise).
// https://github.com/lerna/lerna/issues/2788
await utils.execCommandVerbose('lerna', ['publish', 'from-package', '-y', '--no-verify-access']);
await utils.execCommandVerbose('git', ['push']);
},
},
build: {
fn: async () => {
// Building everything in parallel seems to be unreliable on CI as
// certain scripts randomly fail with missing files or folder, or
// cannot delete certain directories (eg. copyPluginAssets or
// copyApplicationAssets). Because of this, on CI, we run the build
// sequencially. Locally we run it in parallel, which is much
// faster, especially when having to rebuild after adding a
// dependency.
if (process.env.BUILD_SEQUENCIAL === '1') {
await utils.execCommandVerbose('yarn', ['run', 'buildSequential']);
} else {
await utils.execCommandVerbose('yarn', ['run', 'buildParallel']);
}
},
},
};
utils.registerGulpTasks(gulp, tasks);