From c405b63e6e3a356246f6a9150f4a662ec9cfca21 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Mon, 19 Aug 2024 10:00:50 -0400 Subject: [PATCH] [ci] Only run maestro steps on official builds (#9217) The "Darc: Maestro Production" resource is not available in the PR build pipeline. --- build-tools/automation/azure-pipelines.yaml | 53 +++++++++++---------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index aa996bb4637..11d90f8c1c1 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -600,32 +600,33 @@ extends: arguments: -c $(XA.Build.Configuration) -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\bootstrap.binlog condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) - - task: AzureCLI@2 - displayName: generate and publish BAR manifest - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: inlineScript - inlineScript: >- - dotnet build $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj - -t:PushManifestToBuildAssetRegistry - -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\ - -c $(XA.Build.Configuration) -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog - condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) - - - task: AzureCLI@2 - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: inlineScript - inlineScript: | - $versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16' - $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content - $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - & dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n - & $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --ci --publishing-infra-version 3 --azdev-pat $(System.AccessToken) - displayName: add build to default darc channel - condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) + - ${{ if eq(variables['MicroBuildSignType'], 'Real') }}: + - task: AzureCLI@2 + displayName: generate and publish BAR manifest + inputs: + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: inlineScript + inlineScript: >- + dotnet build $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj + -t:PushManifestToBuildAssetRegistry + -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\ + -c $(XA.Build.Configuration) -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog + condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) + + - task: AzureCLI@2 + inputs: + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: inlineScript + inlineScript: | + $versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16' + $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content + $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' + & dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n + & $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --ci --publishing-infra-version 3 --azdev-pat $(System.AccessToken) + displayName: add build to default darc channel + condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true')) - template: build-tools\automation\yaml-templates\upload-results.yaml@self parameters: