2020-02-20 22:29:09 +00:00
param (
[ Parameter ( Mandatory = $true ) ] [ string ] $PromoteToChannels , # List of channels that the build should be promoted to
[ Parameter ( Mandatory = $true ) ] [ array ] $AvailableChannelIds # List of channel IDs available in the YAML implementation
)
try {
. $PSScriptRoot \ post-build -utils . ps1
2020-04-24 17:34:25 +00:00
if ( $PromoteToChannels -eq " " ) {
Update dependencies from https://github.com/dotnet/arcade build 20231010.1
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.CMake.Sdk
From Version 8.0.0-beta.23463.1 -> To Version 9.0.0-beta.23510.1
Dependency coherency updates
Microsoft.WindowsDesktop.App.Ref,VS.Redist.Common.WindowsDesktop.SharedFramework.x64.9.0,VS.Redist.Common.WindowsDesktop.TargetingPack.x64.9.0,VS.Redist.Common.NetCore.TargetingPack.x64.9.0,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.FSharp.Compiler,Microsoft.SourceBuild.Intermediate.fsharp,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.DotNet.XliffTasks
From Version 9.0.0-alpha.1.23456.3 -> To Version 9.0.0-alpha.1.23471.7 (parent: Microsoft.NET.Sdk
2023-10-10 12:19:36 +00:00
Write-PipelineTaskError -Type 'warning' -Message " This build won't publish assets as it's not configured to any Maestro channel. If that wasn't intended use Darc to configure a default channel using add-default-channel for this branch or to promote it to a channel using add-build-to-channel. See https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#assigning-an-individual-build-to-a-channel for more info. "
2020-04-24 17:34:25 +00:00
ExitWithExitCode 0
}
2020-02-20 22:29:09 +00:00
# Check that every channel that Maestro told to promote the build to
# is available in YAML
$PromoteToChannelsIds = $PromoteToChannels -split " \D " | Where-Object { $_ }
2020-07-08 13:11:11 +00:00
$hasErrors = $false
2020-02-20 22:29:09 +00:00
foreach ( $id in $PromoteToChannelsIds ) {
if ( ( $id -ne 0 ) -and ( $id -notin $AvailableChannelIds ) ) {
2020-04-30 12:44:30 +00:00
Write-PipelineTaskError -Message " Channel $id is not present in the post-build YAML configuration! This is an error scenario. Please contact @dnceng. "
2020-07-08 13:11:11 +00:00
$hasErrors = $true
2020-02-20 22:29:09 +00:00
}
}
2020-07-08 13:11:11 +00:00
# The `Write-PipelineTaskError` doesn't error the script and we might report several errors
# in the previous lines. The check below makes sure that we return an error state from the
# script if we reported any validation error
if ( $hasErrors ) {
ExitWithExitCode 1
}
2020-02-20 22:29:09 +00:00
Write-Host 'done.'
}
catch {
Write-Host $_
Write-PipelineTelemetryError -Category 'CheckChannelConsistency' -Message " There was an error while trying to check consistency of Maestro default channels for the build and post-build YAML configuration. "
ExitWithExitCode 1
}