forked from tidev/vscode-titanium
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dangerfile.js
28 lines (25 loc) · 901 Bytes
/
dangerfile.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
const eslint = require('@seadub/danger-plugin-eslint').default;
const junit = require('@seadub/danger-plugin-junit').default;
const dependencies = require('@seadub/danger-plugin-dependencies').default;
async function linkToVsix () {
if (process.env.BUILD_STATUS === 'SUCCESS' || process.env.BUILD_STATUS === 'UNSTABLE') {
const { version } = require('./package.json');
const vsixName = `vscode-titanium-${version}.vsix`;
const vsixLink = danger.utils.href(`${process.env.BUILD_URL}artifact/${vsixName}`, 'Here\'s the built vsix for this change');
message(`:floppy_disk: ${vsixLink}.`);
}
}
async function main() {
await Promise.all([
eslint(null, [ '.ts' ]),
junit({ pathToReport: './junit_report.xml', name: 'Unit Tests' }),
dependencies({ type: 'npm' }),
linkToVsix()
]);
}
main()
.then(() => process.exit(0))
.catch(err => {
fail(err.toString());
process.exit(1);
});