Skip to content

Commit

Permalink
[ci] Only run maestro steps on official builds (#9217)
Browse files Browse the repository at this point in the history
The "Darc: Maestro Production" resource is not available in the PR build
pipeline.
  • Loading branch information
pjcollins authored Aug 19, 2024
1 parent 07cb311 commit c405b63
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c405b63

Please sign in to comment.