8a09100478
[master] Update dependencies from dotnet/arcade - Coherency Updates: - Microsoft.SourceLink.GitHub: from 1.1.0-beta-20527-05 to 1.1.0-beta-20566-02 (parent: Microsoft.DotNet.Arcade.Sdk) - XliffTasks: from 1.0.0-beta.20531.1 to 1.0.0-beta.20563.1 (parent: Microsoft.DotNet.Arcade.Sdk) - Merge branch 'master' of https://github.com/dotnet/installer into darc-master-2915ed78-2cd6-4181-a821-0cc8fa5ea2ac
80 lines
2.9 KiB
PowerShell
80 lines
2.9 KiB
PowerShell
param(
|
|
[Parameter(Mandatory=$true)][int] $BuildId,
|
|
[Parameter(Mandatory=$true)][int] $PublishingInfraVersion,
|
|
[Parameter(Mandatory=$true)][string] $AzdoToken,
|
|
[Parameter(Mandatory=$true)][string] $MaestroToken,
|
|
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com',
|
|
[Parameter(Mandatory=$true)][string] $WaitPublishingFinish,
|
|
[Parameter(Mandatory=$false)][string] $EnableSourceLinkValidation,
|
|
[Parameter(Mandatory=$false)][string] $EnableSigningValidation,
|
|
[Parameter(Mandatory=$false)][string] $EnableNugetValidation,
|
|
[Parameter(Mandatory=$false)][string] $PublishInstallersAndChecksums,
|
|
[Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters,
|
|
[Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters,
|
|
[Parameter(Mandatory=$false)][string] $SigningValidationAdditionalParameters
|
|
)
|
|
|
|
try {
|
|
. $PSScriptRoot\post-build-utils.ps1
|
|
# Hard coding darc version till the next arcade-services roll out, cos this version has required API changes for darc add-build-to-channel
|
|
$darc = Get-Darc "1.1.0-beta.20418.1"
|
|
|
|
$optionalParams = [System.Collections.ArrayList]::new()
|
|
|
|
if ("" -ne $ArtifactsPublishingAdditionalParameters) {
|
|
$optionalParams.Add("artifact-publishing-parameters") | Out-Null
|
|
$optionalParams.Add($ArtifactsPublishingAdditionalParameters) | Out-Null
|
|
}
|
|
|
|
if ("" -ne $SymbolPublishingAdditionalParameters) {
|
|
$optionalParams.Add("symbol-publishing-parameters") | Out-Null
|
|
$optionalParams.Add($SymbolPublishingAdditionalParameters) | Out-Null
|
|
}
|
|
|
|
if ("false" -eq $WaitPublishingFinish) {
|
|
$optionalParams.Add("--no-wait") | Out-Null
|
|
}
|
|
|
|
if ("false" -ne $PublishInstallersAndChecksums) {
|
|
$optionalParams.Add("--publish-installers-and-checksums") | Out-Null
|
|
}
|
|
|
|
if ("true" -eq $EnableNugetValidation) {
|
|
$optionalParams.Add("--validate-nuget") | Out-Null
|
|
}
|
|
|
|
if ("true" -eq $EnableSourceLinkValidation) {
|
|
$optionalParams.Add("--validate-sourcelinkchecksums") | Out-Null
|
|
}
|
|
|
|
if ("true" -eq $EnableSigningValidation) {
|
|
$optionalParams.Add("--validate-signingchecksums") | Out-Null
|
|
|
|
if ("" -ne $SigningValidationAdditionalParameters) {
|
|
$optionalParams.Add("--signing-validation-parameters") | Out-Null
|
|
$optionalParams.Add($SigningValidationAdditionalParameters) | Out-Null
|
|
}
|
|
}
|
|
|
|
& $darc add-build-to-channel `
|
|
--id $buildId `
|
|
--publishing-infra-version $PublishingInfraVersion `
|
|
--default-channels `
|
|
--source-branch master `
|
|
--azdev-pat $AzdoToken `
|
|
--bar-uri $MaestroApiEndPoint `
|
|
--password $MaestroToken `
|
|
@optionalParams
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
Write-Host "Problems using Darc to promote build ${buildId} to default channels. Stopping execution..."
|
|
exit 1
|
|
}
|
|
|
|
Write-Host 'done.'
|
|
}
|
|
catch {
|
|
Write-Host $_
|
|
Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to publish build '$BuildId' to default channels."
|
|
ExitWithExitCode 1
|
|
}
|