Add upload-vsix to travis ci (#402)
This commit is contained in:
Родитель
16249c5ba1
Коммит
e0d41f175b
|
@ -16,7 +16,8 @@ install:
|
|||
- npm install
|
||||
|
||||
script:
|
||||
- npm run vscode:prepublish
|
||||
- gulp package
|
||||
- gulp upload-vsix
|
||||
- npm test
|
||||
|
||||
notifications:
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const azureStorage = require('azure-storage');
|
||||
const vsce = require('vsce');
|
||||
const packageJson = require('./package.json');
|
||||
|
||||
gulp.task('package', async () => {
|
||||
await vsce.createVSIX();
|
||||
});
|
||||
|
||||
gulp.task('upload-vsix', (callback) => {
|
||||
if (process.env.TRAVIS_PULL_REQUEST_BRANCH) {
|
||||
console.log('Skipping upload-vsix for PR build.');
|
||||
} else {
|
||||
const containerName = packageJson.name;
|
||||
const vsixName = `${packageJson.name}-${packageJson.version}.vsix`;
|
||||
const blobPath = path.join(process.env.TRAVIS_BRANCH, process.env.TRAVIS_BUILD_NUMBER, vsixName);
|
||||
const blobService = azureStorage.createBlobService(process.env.STORAGE_NAME, process.env.STORAGE_KEY);
|
||||
blobService.createContainerIfNotExists(containerName, { publicAccessLevel: "blob" }, (err) => {
|
||||
if (err) {
|
||||
callback(err);
|
||||
} else {
|
||||
blobService.createBlockBlobFromLocalFile(containerName, blobPath, vsixName, (err) => {
|
||||
if (err) {
|
||||
callback(err);
|
||||
} else {
|
||||
const brightYellowFormatting = '\x1b[33m\x1b[1m%s\x1b[0m';
|
||||
const brightWhiteFormatting = '\x1b[1m%s\x1b[0m';
|
||||
console.log();
|
||||
console.log(brightYellowFormatting, '================================================ vsix url ================================================');
|
||||
console.log();
|
||||
console.log(brightWhiteFormatting, blobService.getUrl(containerName, blobPath));
|
||||
console.log();
|
||||
console.log(brightYellowFormatting, '==========================================================================================================');
|
||||
console.log();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
|
@ -706,9 +706,12 @@
|
|||
"@types/socket.io-client": "^1.4.27",
|
||||
"@types/d3": "5.0.0",
|
||||
"antlr4ts-cli": "^0.4.0-alpha.4",
|
||||
"azure-storage": "^2.8.1",
|
||||
"gulp": "^3.9.1",
|
||||
"mocha": "^2.3.3",
|
||||
"typescript": "^2.0.3",
|
||||
"vscode": "^1.0.0"
|
||||
"vscode": "^1.0.0",
|
||||
"vsce": "^1.37.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"antlr4ts": "^0.4.0-alpha.4",
|
||||
|
|
Загрузка…
Ссылка в новой задаче