Skip to content

Commit

Permalink
fixing build numbering for releases (Azure#8008)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettsam authored Dec 15, 2021
1 parent b99c08f commit f23a5d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<LangVersion>latest</LangVersion>
<MajorVersion>4</MajorVersion>
<MinorVersion>1</MinorVersion>
<PatchVersion>0</PatchVersion>
<PatchVersion>1</PatchVersion>
<BuildNumber Condition="'$(BuildNumber)' == '' ">0</BuildNumber>
<PreviewVersion></PreviewVersion>

Expand Down
13 changes: 11 additions & 2 deletions build/initialize-pipeline.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
$buildReason = $env:BUILD_REASON
$sourceBranch = $env:BUILD_SOURCEBRANCH

Write-Host "BUILD_REASON: '$buildReason'"
Write-Host "BUILD_SOURCEBRANCH: '$sourceBranch'"

if ($buildReason -eq "PullRequest") {
# parse PR title to see if we should pack this
Expand All @@ -11,8 +15,13 @@ if ($buildReason -eq "PullRequest") {
}
}

$buildNumber = $env:buildNumber
Write-Host "BuildNumber: '$buildNumber'"
$buildNumber = ""

if(($buildReason -eq "PullRequest") -or !($sourceBranch.ToLower().Contains("release/4.")))
{
$buildNumber = $env:buildNumber
Write-Host "BuildNumber: '$buildNumber'"
}

Import-Module $PSScriptRoot\Get-AzureFunctionsVersion -Force
$version = Get-AzureFunctionsVersion $buildNumber $buildNumber
Expand Down

0 comments on commit f23a5d2

Please sign in to comment.