[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:
Rolf Bjarne Kvinge 2022-04-04 17:51:46 +02:00 коммит произвёл GitHub
Родитель 40d604fa43
Коммит 5afbfb4de0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -136,6 +136,12 @@ steps:
$macPkg = Get-ChildItem -Path $pkgsPath -File -Force -Name xamarin.mac-*.pkg $macPkg = Get-ChildItem -Path $pkgsPath -File -Force -Name xamarin.mac-*.pkg
Write-Host "mac PKG is $macPkg" 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: # create an array with objects so that we can set each of the statuses:
$statusInfo = @( $statusInfo = @(
@{ @{
@ -144,6 +150,7 @@ steps:
Description = $iOSPkg; Description = $iOSPkg;
TargetUrl = "$pkgsVirtualUrl/$iOSPkg"; TargetUrl = "$pkgsVirtualUrl/$iOSPkg";
Error = "xamarin.ios pkg not found"; Error = "xamarin.ios pkg not found";
ShouldExist = $true;
}, },
@{ @{
Path = "$pkgsPath\\notarized\\xamarin.ios-*.pkg"; Path = "$pkgsPath\\notarized\\xamarin.ios-*.pkg";
@ -151,6 +158,7 @@ steps:
Description = "$iOSPkg (Notarized)" ; Description = "$iOSPkg (Notarized)" ;
TargetUrl = "$pkgsVirtualUrl/notarized/$iOSPkg" ; TargetUrl = "$pkgsVirtualUrl/notarized/$iOSPkg" ;
Error = "Notarized xamarin.ios pkg not found" ; Error = "Notarized xamarin.ios pkg not found" ;
ShouldExist = $notarizedShouldExist;
}, },
@{ @{
Path = "$pkgsPath\\xamarin.mac-*.pkg" ; Path = "$pkgsPath\\xamarin.mac-*.pkg" ;
@ -158,6 +166,7 @@ steps:
Description = "$macPkg" ; Description = "$macPkg" ;
TargetUrl = "$pkgsVirtualUrl/$macPkg" ; TargetUrl = "$pkgsVirtualUrl/$macPkg" ;
Error = "xamarin.mac pkg not found." ; Error = "xamarin.mac pkg not found." ;
ShouldExist = $true;
}, },
@{ @{
Path = "$pkgsPath\\notarized\\xamarin.mac-*.pkg" ; Path = "$pkgsPath\\notarized\\xamarin.mac-*.pkg" ;
@ -165,6 +174,7 @@ steps:
Description = "$macPkg (Notarized)" ; Description = "$macPkg (Notarized)" ;
TargetUrl = "$pkgsVirtualUrl/notarized/$macPkg" ; TargetUrl = "$pkgsVirtualUrl/notarized/$macPkg" ;
Error = "Notarized xamarin.mac pkg not found." ; Error = "Notarized xamarin.mac pkg not found." ;
ShouldExist = $notarizedShouldExist;
}, },
@{ @{
Path = "$pkgsPath\bundle.zip" ; Path = "$pkgsPath\bundle.zip" ;
@ -172,6 +182,7 @@ steps:
Description = "bundle.zip" ; Description = "bundle.zip" ;
TargetUrl = "$pkgsVirtualUrl/bundle.zip" ; TargetUrl = "$pkgsVirtualUrl/bundle.zip" ;
Error = "bundle.zip not found." ; Error = "bundle.zip not found." ;
ShouldExist = $true;
}, },
@{ @{
Path = "$pkgsPath\msbuild.zip" ; Path = "$pkgsPath\msbuild.zip" ;
@ -179,13 +190,14 @@ steps:
Description = "msbuild.zip" ; Description = "msbuild.zip" ;
TargetUrl = "$pkgsVirtualUrl/msbuild.zip" ; TargetUrl = "$pkgsVirtualUrl/msbuild.zip" ;
Error = "msbuild.zip not found." ; Error = "msbuild.zip not found." ;
ShouldExist = $true;
} }
) )
foreach ($info in $statusInfo) { foreach ($info in $statusInfo) {
if (Test-Path $info.Path -PathType Leaf) { if (Test-Path $info.Path -PathType Leaf) {
Set-GitHubStatus -Status "success" -Description $info.Description -TargetUrl $info.TargetUrl -Context $info.Context 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 Set-GitHubStatus -Status "error" -Description $info.Error -Context $info.Context
} }
} }