Skip to content

Commit 8a85c10

Browse files
authored
[ci] Use passwordless auth for darc/maestro (#9182)
Fixes: #9164 Migrates darc/maestro commands to use a passwordless auth flow, as token based authentication is deprecated and will be removed in the future.
1 parent bf9f03a commit 8a85c10

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,6 @@ extends:
549549
os: windows
550550
workspace:
551551
clean: all
552-
variables:
553-
- ${{ if eq(variables['MicroBuildSignType'], 'Real') }}:
554-
- group: Publish-Build-Assets
555552
templateContext:
556553
outputs:
557554
- output: artifactsDrop
@@ -566,6 +563,12 @@ extends:
566563
clean: true
567564
submodules: recursive
568565

566+
- task: UseDotNet@2
567+
displayName: Install .NET 9.x
568+
inputs:
569+
version: 9.x
570+
includePreviewVersions: true
571+
569572
# Download symbols to be published to the symbols artifact drop declared above
570573
- task: DownloadPipelineArtifact@2
571574
inputs:
@@ -599,23 +602,30 @@ extends:
599602
arguments: -c $(XA.Build.Configuration) -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\bootstrap.binlog
600603
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
601604

602-
- task: DotNetCoreCLI@2
605+
- task: AzureCLI@2
603606
displayName: generate and publish BAR manifest
604607
inputs:
605-
projects: $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
606-
arguments: >-
608+
azureSubscription: "Darc: Maestro Production"
609+
scriptType: ps
610+
scriptLocation: inlineScript
611+
inlineScript: >-
612+
dotnet build $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
607613
-t:PushManifestToBuildAssetRegistry
608-
-p:BuildAssetRegistryToken=$(MaestroAccessToken)
609614
-p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
610615
-c $(XA.Build.Configuration) -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog
611616
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
612617

613-
- powershell: |
614-
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16'
615-
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
616-
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
617-
& dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n
618-
& $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --publishing-infra-version 3 --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
618+
- task: AzureCLI@2
619+
inputs:
620+
azureSubscription: "Darc: Maestro Production"
621+
scriptType: ps
622+
scriptLocation: inlineScript
623+
inlineScript: |
624+
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16'
625+
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
626+
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
627+
& dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n
628+
& $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --ci --publishing-infra-version 3 --azdev-pat $(System.AccessToken)
619629
displayName: add build to default darc channel
620630
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
621631

build-tools/create-packs/Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
<RemoveDir Directories="@(_PackFoldersToDelete)" />
164164
</Target>
165165

166-
<!-- https://github.com/dotnet/arcade/blob/efc3da96e5ac110513e92ebd9ef87c73f44d8540/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
166+
<!-- https://github.com/dotnet/arcade/blob/00d6decc59f5030c2399a64fd3e4f6e8e11bacca/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
167167
<Target Name="PushManifestToBuildAssetRegistry"
168168
DependsOnTargets="GetXAVersionInfo" >
169169
<PropertyGroup>
@@ -192,7 +192,7 @@
192192
<ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
193193
</ItemGroup>
194194

195-
<PushToAzureDevOpsArtifacts
195+
<PushToBuildStorage
196196
ItemsToPush="@(ItemsToPush)"
197197
IsStableBuild="$(IsStableBuild)"
198198
ManifestBuildData="@(ManifestBuildData)"

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<Uri>https://github.com/dotnet/arcade</Uri>
2727
<Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
2828
</Dependency>
29-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24225.1">
29+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.24408.2">
3030
<Uri>https://github.com/dotnet/arcade</Uri>
31-
<Sha>67d23f4ba1813b315e7e33c71d18b63475f5c5f8</Sha>
31+
<Sha>60ae233c3d77f11c5fdb53e570b64d503b13ba59</Sha>
3232
</Dependency>
3333
<Dependency Name="Microsoft.TemplateEngine.Tasks" Version="7.0.100-rc.1.22410.7">
3434
<Uri>https://github.com/dotnet/templating</Uri>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<MicrosoftNETILLinkTasksPackageVersion>9.0.0-rc.1.24408.12</MicrosoftNETILLinkTasksPackageVersion>
77
<MicrosoftNETCoreAppRefPackageVersion>9.0.0-rc.1.24408.12</MicrosoftNETCoreAppRefPackageVersion>
88
<MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
9-
<MicrosoftDotNetBuildTasksFeedPackageVersion>8.0.0-beta.24225.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
9+
<MicrosoftDotNetBuildTasksFeedPackageVersion>9.0.0-beta.24408.2</MicrosoftDotNetBuildTasksFeedPackageVersion>
1010
<MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-rc.1.24402.2</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
1111
<MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>
1212
<MicrosoftTemplateEngineTasksPackageVersion>7.0.100-rc.1.22410.7</MicrosoftTemplateEngineTasksPackageVersion>

0 commit comments

Comments
 (0)