Skip to content

Commit 134d969

Browse files
committed
Additional fixes to build scripts for automated builds
1 parent dffe182 commit 134d969

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

buildutils.ps1

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -352,37 +352,28 @@ function Get-CurrentBuildKind
352352
$currentBuildKind = [BuildKind]::LocalBuild
353353

354354
# IsAutomatedBuild is the top level gate (e.g. if it is false, all the others must be false)
355-
$isAutomatedBuild = [System.Convert]::ToBoolean($env:IsAutomatedBuild) `
356-
-or $env:CI `
357-
-or $env:APPVEYOR `
358-
-or $env:GITHUB_ACTIONS
355+
$isAutomatedBuild = $env:CI `
356+
-or $env:APPVEYOR `
357+
-or $env:GITHUB_ACTIONS
359358

360359
if( $isAutomatedBuild )
361360
{
362361
# IsPullRequestBuild indicates an automated buddy build and should not be trusted
363-
$isPullRequestBuild = [System.Convert]::ToBoolean($env:IsPullRequestBuild)
364-
if(!$isPullRequestBuild)
365-
{
366-
$isPullRequestBuild = $env:GITHUB_BASE_REF -or $env:APPVEYOR_PULL_REQUEST_NUMBER
367-
}
362+
$isPullRequestBuild = $env:GITHUB_BASE_REF -or $env:APPVEYOR_PULL_REQUEST_NUMBER
368363

369364
if($isPullRequestBuild)
370365
{
371366
$currentBuildKind = [BuildKind]::PullRequestBuild
372367
}
373368
else
374369
{
375-
$isReleaseBuild = [System.Convert]::ToBoolean($env:IsReleaseBuild)
376-
if(!$isReleaseBuild -and !$isPullRequestBuild)
370+
if($env:APPVEYOR)
371+
{
372+
$isReleaseBuild = $env:APPVEYOR_REPO_TAG
373+
}
374+
elseif($env:GITHUB_ACTIONS)
377375
{
378-
if($env:APPVEYOR)
379-
{
380-
$isReleaseBuild = $env:APPVEYOR_REPO_TAG
381-
}
382-
else
383-
{
384-
$isReleaseBuild = $env:GITHUB_REF -like 'refs/tags/*'
385-
}
376+
$isReleaseBuild = $env:GITHUB_REF -like 'refs/tags/*'
386377
}
387378

388379
if($isReleaseBuild)
@@ -459,7 +450,8 @@ function Initialize-BuildEnvironment
459450

460451
Write-Information "MSBUILD:`n$($msbuild | Format-Table -AutoSize | Out-String)"
461452
Write-Information (dir env:Is* | Format-Table -Property Name, value | Out-String)
462-
Write-Information "BuildKind: $global:BuildKind"
453+
Write-Information "BuildKind: $global:CurrentBuildKind"
454+
Write-Information "CiBuildName: $env:CiBuildName"
463455
Write-Information 'PATH:'
464456
$($env:Path -split ';') | %{ Write-Information $_ }
465457

0 commit comments

Comments
 (0)