mirror of
https://github.com/atom/atom.git
synced 2026-01-25 23:08:18 -05:00
Add GetReleaseVersion step to set ReleaseVersion variable
This commit is contained in:
11
script/vsts/get-version.js
Normal file
11
script/vsts/get-version.js
Normal file
@@ -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}`)
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user