-
Notifications
You must be signed in to change notification settings - Fork 5
/
make.js
41 lines (35 loc) · 998 Bytes
/
make.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
#!/usr/bin/env node
/**
* Module dependencies
*/
const commander = require('commander');
const fs = require('fs-extra');
const packageMetadata = require('./package.json');
const ci = require('ci-build-tools')(process.env.GIT_TAG_PUSHER);
const version = ci.GetVersion();
commander.version(version);
/**
* Build
*/
commander
.command('build')
.description('Setup require build files for npm package.')
.action(async () => {
packageMetadata.version = version;
await fs.writeJson('./package.json', packageMetadata, { spaces: 2 });
console.log('Building package %s (%s)', packageMetadata.name, version);
console.log('');
});
/**
* After Build
*/
commander
.command('after_build')
.description('Publishes git tags and reports failures.')
.action(() => {
console.log('After build package %s (%s)', packageMetadata.name, version);
console.log('');
ci.PublishGitTag();
ci.MergeDownstream('release/', 'master');
});
commander.parse(process.argv);