Skip to content

Commit

Permalink
Restores build version string for release packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
gingi committed Feb 3, 2023
1 parent c1722ac commit 1d7ac1a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
5 changes: 1 addition & 4 deletions .vsts/common/set-dist-vars.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
steps:

- powershell: $(Build.SourcesDirectory)/scripts/azpipelines/build-type.ps1 "$(Build.SourceBranch)" "$(Build.BuildNumber)"
displayName: Resolve build type

- powershell: $(Build.SourcesDirectory)/scripts/azpipelines/update-build-name.ps1
displayName: Resolve version
displayName: Resolve build info
6 changes: 6 additions & 0 deletions .vsts/win/distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ steps:
- template: ./credscan.yml
- template: ./win-dependencies.yml

- powershell: |
$version = npm run -s ts scripts/package/get-version
Write-Host "Updating build number to $version"
Write-Host "##vso[build.updatebuildnumber]$version"
displayName: Update build version for packaging
- powershell: |
. .vsts/win/exec.ps1
$ErrorActionPreference = "Stop"
Expand Down
10 changes: 5 additions & 5 deletions scripts/azpipelines/build-type.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ param (
$buildNumber
)
# This compute the build type for VSTS build
$buildType="dev"
$buildType = "dev"

Write-Host "Branch is $branch"

If ($branch -like "refs/heads/master") {
$buildType="insider"
$buildType = "insider"
}

If ($branch -like "refs/heads/stable") {
$buildType="stable"
$buildType = "stable"
}

# Change to curent branch for testing
If ($branch -like "refs/heads/feature/signing-vsts") {
$buildType="testing"
$buildType = "testing"
}

Write-Host "Build type is $buildType"
Expand All @@ -26,6 +26,6 @@ Write-Host "##vso[task.setvariable variable=BUILD_TYPE]$buildType"

# Hyphens in the version causes RPM packaging to fail
# See https://azurebatch.visualstudio.com/BatchExplorer/_workitems/edit/379
$newBuildNumber=$buildNumber -replace '-', '_'
$newBuildNumber = $buildNumber -replace '-', '_'
Write-Host "Setting build number to $newBuildNumber"
Write-Host "##vso[build.updatebuildnumber]$newBuildNumber"
4 changes: 0 additions & 4 deletions scripts/azpipelines/update-build-name.ps1

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/package/get-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { version } from "./package-utils";
// eslint-disable no-console
console.log(version);

0 comments on commit 1d7ac1a

Please sign in to comment.