From 5f0955c58ffa69b343c0971a5caa9b59cab4b9ac Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 17 Feb 2019 21:39:06 +0800 Subject: [PATCH] add build artifacts --- azure-pipelines.yml | 18 ++++++++++++++++++ scripts/zip.js | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 012564d2..617f04af 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -64,3 +64,21 @@ jobs: inputs: testRunner: JUnit testResultsFiles: './junit.xml' + +- job: build + displayName: Build & Compile + condition: ne(variables['Build.Reason'], 'PullRequest') + dependsOn: + - php + - javascript + pool: + vmImage: 'Ubuntu-16.04' + steps: + - script: yarn + displayName: Install dependencies + - script: yarn release blessing-skin-server.zip + displayName: Generate package + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'Package file' + targetPath: 'blessing-skin-server.zip' diff --git a/scripts/zip.js b/scripts/zip.js index 93cc2699..99d2a2a5 100644 --- a/scripts/zip.js +++ b/scripts/zip.js @@ -6,7 +6,7 @@ module.exports = function () { const list = fs.readFileSync('./zip.txt', 'utf-8').split('\n'); list.pop(); // Remove the empty line - const output = fs.createWriteStream(`../blessing-skin-server-v${version}.zip`); + const output = fs.createWriteStream(process.argv[2] || `../blessing-skin-server-v${version}.zip`); const archive = archiver('zip', { zlib: { level: 9 } }); return new Promise((resolve, reject) => { @@ -34,3 +34,5 @@ module.exports = function () { archive.finalize(); }); }; + +module.exports();