diff --git a/script/vsts/get-version.js b/script/vsts/get-version.js new file mode 100644 index 000000000..04f980d9b --- /dev/null +++ b/script/vsts/get-version.js @@ -0,0 +1,11 @@ +const path = require('path') + +const repositoryRootPath = path.resolve(__dirname, '..', '..') +const appMetadata = require(path.join(repositoryRootPath, 'package.json')) +const releaseVersion = appMetadata.version + +// Set our ReleaseVersion build variable and update VSTS' build number to +// include the version. Writing these strings to stdout causes VSTS to set +// the associated variables. +console.log(`##vso[task.setvariable variable=ReleaseVersion;isOutput=true]${releaseVersion}`) +console.log(`##vso[build.updatebuildnumber]${releaseVersion}+${process.env.BUILD_BUILDNUMBER}`) diff --git a/script/vsts/stable-beta-release.yml b/script/vsts/stable-beta-release.yml index 390011856..f9c6d3f6f 100644 --- a/script/vsts/stable-beta-release.yml +++ b/script/vsts/stable-beta-release.yml @@ -3,15 +3,18 @@ trigger: phases: +- phase: GetReleaseVersion + steps: + # This has to be done separately because VSTS inexplicably + # exits the script block after `npm install` completes. + - script: | + cd script\vsts + npm install + displayName: npm install + - script: node script\vsts\get-version.js + name: Version + # Import OS-specific build definitions - template: windows.yml - template: macos.yml - template: linux.yml - -- phase: Release - queue: Hosted # Need this for Python 2.7 - - dependsOn: - - Windows - - Linux - - macOS