[devops] Don't add a failure status for missing notarized packages in PR builds. (#14591)
We're not even trying to notarize packages for PR builds (by design), so we shouldn't create a failure status.
This commit is contained in:
Родитель
40d604fa43
Коммит
5afbfb4de0
|
@ -136,6 +136,12 @@ steps:
|
|||
$macPkg = Get-ChildItem -Path $pkgsPath -File -Force -Name xamarin.mac-*.pkg
|
||||
Write-Host "mac PKG is $macPkg"
|
||||
|
||||
if ($Env:BUILD_REASON -eq "PullRequest") {
|
||||
$notarizedShouldExist = $false;
|
||||
} else {
|
||||
$notarizedShouldExist = $true;
|
||||
}
|
||||
|
||||
# create an array with objects so that we can set each of the statuses:
|
||||
$statusInfo = @(
|
||||
@{
|
||||
|
@ -144,6 +150,7 @@ steps:
|
|||
Description = $iOSPkg;
|
||||
TargetUrl = "$pkgsVirtualUrl/$iOSPkg";
|
||||
Error = "xamarin.ios pkg not found";
|
||||
ShouldExist = $true;
|
||||
},
|
||||
@{
|
||||
Path = "$pkgsPath\\notarized\\xamarin.ios-*.pkg";
|
||||
|
@ -151,6 +158,7 @@ steps:
|
|||
Description = "$iOSPkg (Notarized)" ;
|
||||
TargetUrl = "$pkgsVirtualUrl/notarized/$iOSPkg" ;
|
||||
Error = "Notarized xamarin.ios pkg not found" ;
|
||||
ShouldExist = $notarizedShouldExist;
|
||||
},
|
||||
@{
|
||||
Path = "$pkgsPath\\xamarin.mac-*.pkg" ;
|
||||
|
@ -158,6 +166,7 @@ steps:
|
|||
Description = "$macPkg" ;
|
||||
TargetUrl = "$pkgsVirtualUrl/$macPkg" ;
|
||||
Error = "xamarin.mac pkg not found." ;
|
||||
ShouldExist = $true;
|
||||
},
|
||||
@{
|
||||
Path = "$pkgsPath\\notarized\\xamarin.mac-*.pkg" ;
|
||||
|
@ -165,6 +174,7 @@ steps:
|
|||
Description = "$macPkg (Notarized)" ;
|
||||
TargetUrl = "$pkgsVirtualUrl/notarized/$macPkg" ;
|
||||
Error = "Notarized xamarin.mac pkg not found." ;
|
||||
ShouldExist = $notarizedShouldExist;
|
||||
},
|
||||
@{
|
||||
Path = "$pkgsPath\bundle.zip" ;
|
||||
|
@ -172,6 +182,7 @@ steps:
|
|||
Description = "bundle.zip" ;
|
||||
TargetUrl = "$pkgsVirtualUrl/bundle.zip" ;
|
||||
Error = "bundle.zip not found." ;
|
||||
ShouldExist = $true;
|
||||
},
|
||||
@{
|
||||
Path = "$pkgsPath\msbuild.zip" ;
|
||||
|
@ -179,13 +190,14 @@ steps:
|
|||
Description = "msbuild.zip" ;
|
||||
TargetUrl = "$pkgsVirtualUrl/msbuild.zip" ;
|
||||
Error = "msbuild.zip not found." ;
|
||||
ShouldExist = $true;
|
||||
}
|
||||
)
|
||||
|
||||
foreach ($info in $statusInfo) {
|
||||
if (Test-Path $info.Path -PathType Leaf) {
|
||||
Set-GitHubStatus -Status "success" -Description $info.Description -TargetUrl $info.TargetUrl -Context $info.Context
|
||||
} else {
|
||||
} elseif ($info.ShouldExist) {
|
||||
Set-GitHubStatus -Status "error" -Description $info.Error -Context $info.Context
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче