From 7c797480c8c69ffcc6421a2044565019e18c2100 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 13:21:58 -0700
Subject: [PATCH 01/17] Test new manifest publish task

---
 build-tools/automation/azure-pipelines.yaml   | 145 ++++++++++--------
 .../create-packs/Directory.Build.targets      |  51 ++++++
 2 files changed, 130 insertions(+), 66 deletions(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index ec9f674a79c..8d61a4295a7 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -526,10 +526,10 @@ extends:
       # Check - "Xamarin.Android (Prepare .NET Release Push Internal)"
       - job: push_signed_nugets
         displayName: Push Internal
-        dependsOn:
-        - nuget_convert
-        - sign_net_linux
-        condition: and(eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.sign_net_linux.result, 'Succeeded'))
+        #dependsOn:
+        #- nuget_convert
+        #- sign_net_linux
+        #condition: and(eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.sign_net_linux.result, 'Succeeded'))
         timeoutInMinutes: 60
         pool: $(VSEngMicroBuildPool)
         workspace:
@@ -551,79 +551,92 @@ extends:
 
         - task: DownloadPipelineArtifact@2
           inputs:
+            buildType: specific
+            project: DevDiv
+            definition: 11410
+            buildVersionToDownload: latestFromBranch
+            allowPartiallySucceededBuilds: true
+            branchName: refs/heads/main
             artifactName: nuget-signed
             downloadPath: $(Build.StagingDirectory)\nuget-signed
 
-        - task: DownloadPipelineArtifact@2
-          inputs:
-            artifactName: nuget-linux-signed
-            downloadPath: $(Build.StagingDirectory)\nuget-signed
-
-        - task: DownloadPipelineArtifact@2
-          inputs:
-            artifactName: vs-msi-nugets
-            downloadPath: $(Build.StagingDirectory)\nuget-signed
-
-        - task: DownloadPipelineArtifact@2
-          inputs:
-            artifactName: $(WindowsToolchainPdbArtifactName)
-            downloadPath: $(Build.StagingDirectory)\nuget-signed
-
-        - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
-          parameters:
-            githubToken: $(GitHub.Token)
-            githubContext: $(NupkgCommitStatusName)
-            blobName: $(NupkgCommitStatusName)
-            packagePrefix: xamarin-android
-            artifactsPath: $(Build.StagingDirectory)\nuget-signed
-            yamlResourceName: yaml-templates
-
-        - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
-          parameters:
-            githubToken: $(GitHub.Token)
-            githubContext: $(VSDropCommitStatusName)
-            blobName: $(VSDropCommitStatusName)
-            packagePrefix: xamarin-android
-            artifactsPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
-            yamlResourceName: yaml-templates
-            downloadSteps:
-            - task: DownloadPipelineArtifact@2
-              inputs:
-                artifactName: vsdrop-signed
-                downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
-
-        - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
-          parameters:
-            githubToken: $(GitHub.Token)
-            githubContext: $(MultiTargetVSDropCommitStatusName)
-            blobName: $(MultiTargetVSDropCommitStatusName)
-            packagePrefix: xamarin-android
-            artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
-            yamlResourceName: yaml-templates
-            downloadSteps:
-            - task: DownloadPipelineArtifact@2
-              inputs:
-                artifactName: vsdrop-multitarget-signed
-                downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
+        #- task: DownloadPipelineArtifact@2
+        #  inputs:
+        #    artifactName: nuget-signed
+        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
+
+        #- task: DownloadPipelineArtifact@2
+        #  inputs:
+        #    artifactName: nuget-linux-signed
+        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
+
+        #- task: DownloadPipelineArtifact@2
+        #  inputs:
+        #    artifactName: vs-msi-nugets
+        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
+
+        #- task: DownloadPipelineArtifact@2
+        #  inputs:
+        #    artifactName: $(WindowsToolchainPdbArtifactName)
+        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
+
+        #- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
+        #  parameters:
+        #    githubToken: $(GitHub.Token)
+        #    githubContext: $(NupkgCommitStatusName)
+        #    blobName: $(NupkgCommitStatusName)
+        #    packagePrefix: xamarin-android
+        #    artifactsPath: $(Build.StagingDirectory)\nuget-signed
+        #    yamlResourceName: yaml-templates
+
+        #- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
+        #  parameters:
+        #    githubToken: $(GitHub.Token)
+        #    githubContext: $(VSDropCommitStatusName)
+        #    blobName: $(VSDropCommitStatusName)
+        #    packagePrefix: xamarin-android
+        #    artifactsPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
+        #    yamlResourceName: yaml-templates
+        #    downloadSteps:
+        #    - task: DownloadPipelineArtifact@2
+        #      inputs:
+        #        artifactName: vsdrop-signed
+        #        downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
+
+        #- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
+        #  parameters:
+        #    githubToken: $(GitHub.Token)
+        #    githubContext: $(MultiTargetVSDropCommitStatusName)
+        #    blobName: $(MultiTargetVSDropCommitStatusName)
+        #    packagePrefix: xamarin-android
+        #    artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
+        #    yamlResourceName: yaml-templates
+        #    downloadSteps:
+        #    - task: DownloadPipelineArtifact@2
+        #      inputs:
+        #        artifactName: vsdrop-multitarget-signed
+        #        downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
 
         - powershell: >-
             & dotnet build -v:n -c $(XA.Build.Configuration)
-            -t:PushManifestToBuildAssetRegistry
+            -t:PublishToBuildAssetRegistry
+            -p:ManifestsPath=$(Build.StagingDirectory)\nuget-signed\AssetManifest
             -p:BuildAssetRegistryToken=$(MaestroAccessToken)
+            -p:MaestroApiEndpoint=https://maestro.dot.net
             -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
             $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
             -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog
           displayName: generate and publish BAR manifest
-          condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
-
-        - powershell: |
-            $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/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) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
-          displayName: add build to default darc channel
-          condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
+          #condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
+
+        #- powershell: |
+        #    $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/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) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
+        #  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:
diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index 5bfd934d2f1..c3d8a67240c 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -10,6 +10,7 @@
   <Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" Version="$(MicrosoftDotNetBuildTasksFeedPackageVersion)" />
 
   <UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetSharedFrameworkTaskFile)"/>
+  <UsingTask TaskName="Microsoft.DotNet.Build.Tasks.Feed.PushToBuildStorage" AssemblyFile="$(MicrosoftDotNetBuildTasksFeedFilePath)" />
   <UsingTask TaskName="GenerateBuildManifest" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
   <UsingTask TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" AssemblyFile="$(PrepTasksAssembly)" />
 
@@ -164,6 +165,56 @@
     <RemoveDir Directories="@(_PackFoldersToDelete)" />
   </Target>
 
+  <!-- https://github.com/dotnet/arcade/blob/d8a997bd4a23c6d6fe7c785b3b440be7dd8463e9/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
+  <Target Name="PublishToBuildAssetRegistry">
+    <PropertyGroup>
+      <AssetManifestFileName>Assets.xml</AssetManifestFileName>
+      <AssetManifestPath>$(OutputPath)AssetManifest\$(AssetManifestFileName)</AssetManifestPath>
+    </PropertyGroup>
+
+    <Error Condition="Exists($(AssetManifestPath))" Text="The manifest file '$(AssetManifestPath)' already exists." />
+
+    <ItemGroup>
+      <ItemsToPush Include="$(OutputPath)*.nupkg" />
+    </ItemGroup>
+
+    <Error Condition="'@(ItemsToPush)' == ''" Text="No packages to push." />
+
+    <Error Condition="'$(BUILD_BUILDNUMBER)' == ''" Text="The BUILD_BUILDNUMBER property is required." />
+    <Error Condition="'$(ArtifactsLogDir)' == ''" Text="The ArtifactsLogDir property is required." />
+    <Error Condition="'$(BUILD_SOURCEBRANCH)' == ''" Text="The BUILD_SOURCEBRANCH property is required." />
+    <Error Condition="'$(BUILD_SOURCEVERSION)' == ''" Text="The BUILD_SOURCEVERSION property is required." />
+    <Error Condition="'$(BUILD_REPOSITORY_URI)' == ''" Text="The BUILD_REPOSITORY_URI property is required." />
+    <Error Condition="'$(MaestroAccessToken)' == ''" Text="The MaestroAccessToken property is required." />
+    <Error Condition="'$(MaestroApiEndpoint)' == ''" Text="The MaestroApiEndpoint property is required." />
+    <Error Condition="'$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)' == ''" Text="The SYSTEM_TEAMFOUNDATIONCOLLECTIONURI property is required." />
+    <Error Condition="'$(SYSTEM_TEAMPROJECT)' == ''" Text="The SYSTEM_TEAMPROJECT property is required." />
+    <Error Condition="'$(BUILD_BUILDID)' == ''" Text="The BUILD_BUILDID property is required." />
+    <Error Condition="'$(SYSTEM_DEFINITIONID)' == ''" Text="The SYSTEM_DEFINITIONID property is required." />
+
+    <Message Text="Publishing %(ItemsToPush.Identity)" Importance="normal" />
+
+    <ItemGroup>
+      <ManifestBuildData Include="InitialAssetsLocation=TODO" />
+      <ManifestBuildData Include="AzureDevOpsBuildId=$(BUILD_BUILDID)" />
+      <ManifestBuildData Include="AzureDevOpsBuildDefinitionId=$(SYSTEM_DEFINITIONID)" />
+      <ManifestBuildData Include="AzureDevOpsProject=$(SYSTEM_TEAMPROJECT)" />
+      <ManifestBuildData Include="AzureDevOpsBuildNumber=$(BUILD_BUILDNUMBER)" />
+      <ManifestBuildData Include="AzureDevOpsRepository=$(BUILD_REPOSITORY_URI)" />
+      <ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
+    </ItemGroup>
+
+    <PushToBuildStorage
+      ItemsToPush="@(ItemsToPush)"
+      ManifestBuildData="@(ManifestBuildData)"
+      ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
+      ManifestBranch="$(BUILD_SOURCEBRANCH)"
+      ManifestBuildId="$(BUILD_BUILDNUMBER)"
+      ManifestCommit="$(BUILD_SOURCEVERSION)"
+      AssetManifestPath="$(AssetManifestPath)"
+      PublishingVersion="3" />
+  </Target>
+
   <Target Name="PushManifestToBuildAssetRegistry" >
     <ItemGroup>
       <BuildArtifacts Include="$(OutputPath)*.nupkg" />

From e246b260b2805a66a5869e4e3d6e85b45bf91b04 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 13:23:59 -0700
Subject: [PATCH 02/17] Temp testing changes

---
 build-tools/automation/azure-pipelines.yaml | 59 ++-------------------
 1 file changed, 4 insertions(+), 55 deletions(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index 8d61a4295a7..b83e9bd6c36 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -467,62 +467,11 @@ extends:
 
     - stage: dotnet_prepare_release
       displayName: Prepare .NET Release
-      dependsOn:
-      - mac_build
-      - linux_build
-      condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(dependencies.linux_build.result, 'Succeeded'), eq(variables['MicroBuildSignType'], 'Real'))
+      #dependsOn:
+      #- mac_build
+      #- linux_build
+      #condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(dependencies.linux_build.result, 'Succeeded'), eq(variables['MicroBuildSignType'], 'Real'))
       jobs:
-      # Check - "Xamarin.Android (Prepare .NET Release Sign Archives)"
-      - template: sign-artifacts/jobs/v2.yml@yaml-templates
-        parameters:
-          name: sign_net_mac_win
-          poolName: $(VSEngMicroBuildPool)
-          artifactName: $(NuGetArtifactName)
-          signType: $(MicroBuildSignType)
-          signedArtifactName: nuget-signed
-          usePipelineArtifactTasks: true
-          use1ESTemplate: true
-
-      # Check - "Xamarin.Android (Prepare .NET Release Sign Linux Archive)"
-      - template: sign-artifacts/jobs/v2.yml@yaml-templates
-        parameters:
-          name: sign_net_linux
-          displayName: Sign Linux Archive
-          poolName: $(VSEngMicroBuildPool)
-          artifactName: $(LinuxNuGetArtifactName)
-          signType: $(MicroBuildSignType)
-          signedArtifactName: nuget-linux-signed
-          usePipelineArtifactTasks: true
-          use1ESTemplate: true
-
-      # Check - "Xamarin.Android (Prepare .NET Release Convert NuGet to MSI)"
-      - template: nuget-msi-convert/job/v3.yml@yaml-templates
-        parameters:
-          yamlResourceName: yaml-templates
-          dependsOn: sign_net_mac_win
-          artifactName: nuget-signed
-          artifactPatterns: |
-            !*Darwin*
-          propsArtifactName: $(NuGetArtifactName)
-          signType: $(MicroBuildSignType)
-          use1ESTemplate: true
-          postConvertSteps:
-          - task: DownloadPipelineArtifact@2
-            inputs:
-              artifactName: $(NuGetArtifactName)
-              downloadPath: $(Build.StagingDirectory)\sign-verify
-              patterns: |
-                **/SignVerifyIgnore.txt
-
-          - task: MicroBuildCodesignVerify@3
-            displayName: verify signed msi content
-            inputs:
-              TargetFolders: |
-                $(Build.ArtifactStagingDirectory)\bin\manifests
-                $(Build.ArtifactStagingDirectory)\bin\manifests-multitarget
-              ExcludeSNVerify: true
-              ApprovalListPathForCerts: $(Build.StagingDirectory)\sign-verify\SignVerifyIgnore.txt
-
       # Check - "Xamarin.Android (Prepare .NET Release Push Internal)"
       - job: push_signed_nugets
         displayName: Push Internal

From fa27a0d09edcd30f3b64f63f96ab556ea11484e2 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 13:25:38 -0700
Subject: [PATCH 03/17] Temp testing changes

---
 build-tools/automation/azure-pipelines.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index b83e9bd6c36..8367ad03843 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -467,6 +467,7 @@ extends:
 
     - stage: dotnet_prepare_release
       displayName: Prepare .NET Release
+      dependsOn: []
       #dependsOn:
       #- mac_build
       #- linux_build

From d3bb93a093e71cd0e779c418734d35f4276a1cce Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 13:33:41 -0700
Subject: [PATCH 04/17] Temp testing changes

---
 build-tools/automation/azure-pipelines.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index 8367ad03843..f6c81dd6cc7 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -504,9 +504,9 @@ extends:
             buildType: specific
             project: DevDiv
             definition: 11410
-            buildVersionToDownload: latestFromBranch
+            pipelineId: 9568160
+            buildVersionToDownload: specific
             allowPartiallySucceededBuilds: true
-            branchName: refs/heads/main
             artifactName: nuget-signed
             downloadPath: $(Build.StagingDirectory)\nuget-signed
 

From 85282785b1682bf3d86250b0b39428ba2975de27 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 13:38:30 -0700
Subject: [PATCH 05/17] Fix assembly path

---
 build-tools/create-packs/Directory.Build.targets | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index c3d8a67240c..cbeacfe67bd 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -10,7 +10,7 @@
   <Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" Version="$(MicrosoftDotNetBuildTasksFeedPackageVersion)" />
 
   <UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetSharedFrameworkTaskFile)"/>
-  <UsingTask TaskName="Microsoft.DotNet.Build.Tasks.Feed.PushToBuildStorage" AssemblyFile="$(MicrosoftDotNetBuildTasksFeedFilePath)" />
+  <UsingTask TaskName="Microsoft.DotNet.Build.Tasks.Feed.PushToBuildStorage" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
   <UsingTask TaskName="GenerateBuildManifest" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
   <UsingTask TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" AssemblyFile="$(PrepTasksAssembly)" />
 

From 73f618bf54604b343a91d7e4e88ddde9748338f7 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 13:44:10 -0700
Subject: [PATCH 06/17] Add ArtifactsLogDir

---
 build-tools/create-packs/Directory.Build.targets | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index cbeacfe67bd..3c8b96dcc78 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -168,8 +168,9 @@
   <!-- https://github.com/dotnet/arcade/blob/d8a997bd4a23c6d6fe7c785b3b440be7dd8463e9/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
   <Target Name="PublishToBuildAssetRegistry">
     <PropertyGroup>
+      <ArtifactsLogDir>$(OutputPath)</ArtifactsLogDir>
       <AssetManifestFileName>Assets.xml</AssetManifestFileName>
-      <AssetManifestPath>$(OutputPath)AssetManifest\$(AssetManifestFileName)</AssetManifestPath>
+      <AssetManifestPath>$(ArtifactsLogDir)AssetManifest\$(AssetManifestFileName)</AssetManifestPath>
     </PropertyGroup>
 
     <Error Condition="Exists($(AssetManifestPath))" Text="The manifest file '$(AssetManifestPath)' already exists." />
@@ -180,7 +181,7 @@
 
     <Error Condition="'@(ItemsToPush)' == ''" Text="No packages to push." />
 
-    <Error Condition="'$(BUILD_BUILDNUMBER)' == ''" Text="The BUILD_BUILDNUMBER property is required." />
+    <!--Error Condition="'$(BUILD_BUILDNUMBER)' == ''" Text="The BUILD_BUILDNUMBER property is required." />
     <Error Condition="'$(ArtifactsLogDir)' == ''" Text="The ArtifactsLogDir property is required." />
     <Error Condition="'$(BUILD_SOURCEBRANCH)' == ''" Text="The BUILD_SOURCEBRANCH property is required." />
     <Error Condition="'$(BUILD_SOURCEVERSION)' == ''" Text="The BUILD_SOURCEVERSION property is required." />
@@ -190,7 +191,7 @@
     <Error Condition="'$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)' == ''" Text="The SYSTEM_TEAMFOUNDATIONCOLLECTIONURI property is required." />
     <Error Condition="'$(SYSTEM_TEAMPROJECT)' == ''" Text="The SYSTEM_TEAMPROJECT property is required." />
     <Error Condition="'$(BUILD_BUILDID)' == ''" Text="The BUILD_BUILDID property is required." />
-    <Error Condition="'$(SYSTEM_DEFINITIONID)' == ''" Text="The SYSTEM_DEFINITIONID property is required." />
+    <Error Condition="'$(SYSTEM_DEFINITIONID)' == ''" Text="The SYSTEM_DEFINITIONID property is required." /-->
 
     <Message Text="Publishing %(ItemsToPush.Identity)" Importance="normal" />
 

From d11c65466e0bbe5125d3d2ae5ccec851fb09cd5b Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 13:52:51 -0700
Subject: [PATCH 07/17] Update Build.Tasks.Feed

---
 eng/Version.Details.xml | 4 ++--
 eng/Versions.props      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 2350c46bbab..87dbd1c0c8b 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -26,9 +26,9 @@
       <Uri>https://github.com/dotnet/arcade</Uri>
       <Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="7.0.0-beta.22103.1">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.24260.2">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
+      <Sha>480401b003bfd2eb989c315da5d6b99ad13a968c</Sha>
     </Dependency>
     <Dependency Name="Microsoft.TemplateEngine.Tasks" Version="7.0.100-rc.1.22410.7">
       <Uri>https://github.com/dotnet/templating</Uri>
diff --git a/eng/Versions.props b/eng/Versions.props
index df014a9dd8b..847ed0205f0 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -5,7 +5,7 @@
     <MicrosoftNETILLinkTasksPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETILLinkTasksPackageVersion>
     <MicrosoftNETCoreAppRefPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETCoreAppRefPackageVersion>
     <MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
-    <MicrosoftDotNetBuildTasksFeedPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
+    <MicrosoftDotNetBuildTasksFeedPackageVersion>9.0.0-beta.24260.2</MicrosoftDotNetBuildTasksFeedPackageVersion>
     <MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-preview.5.24223.2</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
     <MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>
     <MicrosoftTemplateEngineTasksPackageVersion>7.0.100-rc.1.22410.7</MicrosoftTemplateEngineTasksPackageVersion>

From 05aaa804deb6b5fd9262e4241486f774a3077578 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 14:12:21 -0700
Subject: [PATCH 08/17] Use PushToAzureDevOpsArtifacts

---
 build-tools/create-packs/Directory.Build.targets | 3 +--
 eng/Version.Details.xml                          | 8 ++++----
 eng/Versions.props                               | 4 ++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index 3c8b96dcc78..c3d6b5466c7 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -10,7 +10,6 @@
   <Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" Version="$(MicrosoftDotNetBuildTasksFeedPackageVersion)" />
 
   <UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetSharedFrameworkTaskFile)"/>
-  <UsingTask TaskName="Microsoft.DotNet.Build.Tasks.Feed.PushToBuildStorage" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
   <UsingTask TaskName="GenerateBuildManifest" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
   <UsingTask TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" AssemblyFile="$(PrepTasksAssembly)" />
 
@@ -205,7 +204,7 @@
       <ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
     </ItemGroup>
 
-    <PushToBuildStorage
+    <PushToAzureDevOpsArtifacts
       ItemsToPush="@(ItemsToPush)"
       ManifestBuildData="@(ManifestBuildData)"
       ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 87dbd1c0c8b..3f5e19a50d0 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -22,13 +22,13 @@
     </Dependency>
   </ProductDependencies>
   <ToolsetDependencies>
-    <Dependency Name="Microsoft.DotNet.ApiCompat" Version="7.0.0-beta.22103.1">
+    <Dependency Name="Microsoft.DotNet.ApiCompat" Version="8.0.0-beta.24225.1">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
+      <Sha>67d23f4ba1813b315e7e33c71d18b63475f5c5f8</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.24260.2">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24225.1">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>480401b003bfd2eb989c315da5d6b99ad13a968c</Sha>
+      <Sha>67d23f4ba1813b315e7e33c71d18b63475f5c5f8</Sha>
     </Dependency>
     <Dependency Name="Microsoft.TemplateEngine.Tasks" Version="7.0.100-rc.1.22410.7">
       <Uri>https://github.com/dotnet/templating</Uri>
diff --git a/eng/Versions.props b/eng/Versions.props
index 847ed0205f0..8005de583c4 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -4,8 +4,8 @@
     <MicrosoftDotnetSdkInternalPackageVersion>9.0.100-preview.5.24253.16</MicrosoftDotnetSdkInternalPackageVersion>
     <MicrosoftNETILLinkTasksPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETILLinkTasksPackageVersion>
     <MicrosoftNETCoreAppRefPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETCoreAppRefPackageVersion>
-    <MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
-    <MicrosoftDotNetBuildTasksFeedPackageVersion>9.0.0-beta.24260.2</MicrosoftDotNetBuildTasksFeedPackageVersion>
+    <MicrosoftDotNetApiCompatPackageVersion>8.0.0-beta.24225.1</MicrosoftDotNetApiCompatPackageVersion>
+    <MicrosoftDotNetBuildTasksFeedPackageVersion>8.0.0-beta.24225.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
     <MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-preview.5.24223.2</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
     <MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>
     <MicrosoftTemplateEngineTasksPackageVersion>7.0.100-rc.1.22410.7</MicrosoftTemplateEngineTasksPackageVersion>

From 0337c84f917022d7d9f194ebdf60eb22f50c1324 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 14:23:36 -0700
Subject: [PATCH 09/17] Add publish build step

---
 build-tools/automation/azure-pipelines.yaml      |  2 +-
 build-tools/create-packs/Directory.Build.targets | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index f6c81dd6cc7..a8299ab2104 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -576,7 +576,7 @@ extends:
             -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
             $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
             -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog
-          displayName: generate and publish BAR manifest
+          displayName: generate and publish assets
           #condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
 
         #- powershell: |
diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index c3d6b5466c7..cb1c2cc6f2b 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -164,7 +164,7 @@
     <RemoveDir Directories="@(_PackFoldersToDelete)" />
   </Target>
 
-  <!-- https://github.com/dotnet/arcade/blob/d8a997bd4a23c6d6fe7c785b3b440be7dd8463e9/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
+  <!-- https://github.com/dotnet/arcade/blob/efc3da96e5ac110513e92ebd9ef87c73f44d8540/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
   <Target Name="PublishToBuildAssetRegistry">
     <PropertyGroup>
       <ArtifactsLogDir>$(OutputPath)</ArtifactsLogDir>
@@ -213,6 +213,17 @@
       ManifestCommit="$(BUILD_SOURCEVERSION)"
       AssetManifestPath="$(AssetManifestPath)"
       PublishingVersion="3" />
+
+    <MSBuild
+        Targets="Restore"
+        Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
+        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion)"
+    />
+
+    <MSBuild
+        Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
+        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(ManifestsPath);MaestroApiEndpoint=$(MaestroApiEndpoint)"
+    />
   </Target>
 
   <Target Name="PushManifestToBuildAssetRegistry" >

From 6fb602ed2f6e6a01ee1557a6eb979f4f924008fc Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 14:25:20 -0700
Subject: [PATCH 10/17] Simplify

---
 build-tools/automation/azure-pipelines.yaml      | 2 --
 build-tools/create-packs/Directory.Build.targets | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index a8299ab2104..31c4e0de691 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -570,9 +570,7 @@ extends:
         - powershell: >-
             & dotnet build -v:n -c $(XA.Build.Configuration)
             -t:PublishToBuildAssetRegistry
-            -p:ManifestsPath=$(Build.StagingDirectory)\nuget-signed\AssetManifest
             -p:BuildAssetRegistryToken=$(MaestroAccessToken)
-            -p:MaestroApiEndpoint=https://maestro.dot.net
             -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
             $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
             -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog
diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index cb1c2cc6f2b..1593101cb73 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -222,7 +222,7 @@
 
     <MSBuild
         Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
-        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(ManifestsPath);MaestroApiEndpoint=$(MaestroApiEndpoint)"
+        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(AssetManifestPath);MaestroApiEndpoint=https://maestro.dot.net"
     />
   </Target>
 

From 736060d9217da6747eadefa4d4ea64cb2e036646 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 14:38:56 -0700
Subject: [PATCH 11/17] Fix manifest path

---
 build-tools/create-packs/Directory.Build.targets | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index 1593101cb73..b6737cfc8de 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -222,7 +222,7 @@
 
     <MSBuild
         Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
-        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(AssetManifestPath);MaestroApiEndpoint=https://maestro.dot.net"
+        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(ArtifactsLogDir)AssetManifest;MaestroApiEndpoint=https://maestro.dot.net"
     />
   </Target>
 

From 260873ddc568daccb3e4ee5da095ef57ddc31e1b Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 20:58:07 -0700
Subject: [PATCH 12/17] Revert testing changes

---
 build-tools/automation/azure-pipelines.yaml   | 210 ++++++++++--------
 .../create-packs/Directory.Build.targets      |  53 +----
 2 files changed, 121 insertions(+), 142 deletions(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index 31c4e0de691..c2c2a4e75af 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -467,19 +467,69 @@ extends:
 
     - stage: dotnet_prepare_release
       displayName: Prepare .NET Release
-      dependsOn: []
-      #dependsOn:
-      #- mac_build
-      #- linux_build
-      #condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(dependencies.linux_build.result, 'Succeeded'), eq(variables['MicroBuildSignType'], 'Real'))
+      dependsOn:
+      - mac_build
+      - linux_build
+      condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(dependencies.linux_build.result, 'Succeeded'), eq(variables['MicroBuildSignType'], 'Real'))
       jobs:
+      # Check - "Xamarin.Android (Prepare .NET Release Sign Archives)"
+      - template: sign-artifacts/jobs/v2.yml@yaml-templates
+        parameters:
+          name: sign_net_mac_win
+          poolName: $(VSEngMicroBuildPool)
+          artifactName: $(NuGetArtifactName)
+          signType: $(MicroBuildSignType)
+          signedArtifactName: nuget-signed
+          usePipelineArtifactTasks: true
+          use1ESTemplate: true
+
+      # Check - "Xamarin.Android (Prepare .NET Release Sign Linux Archive)"
+      - template: sign-artifacts/jobs/v2.yml@yaml-templates
+        parameters:
+          name: sign_net_linux
+          displayName: Sign Linux Archive
+          poolName: $(VSEngMicroBuildPool)
+          artifactName: $(LinuxNuGetArtifactName)
+          signType: $(MicroBuildSignType)
+          signedArtifactName: nuget-linux-signed
+          usePipelineArtifactTasks: true
+          use1ESTemplate: true
+
+      # Check - "Xamarin.Android (Prepare .NET Release Convert NuGet to MSI)"
+      - template: nuget-msi-convert/job/v3.yml@yaml-templates
+        parameters:
+          yamlResourceName: yaml-templates
+          dependsOn: sign_net_mac_win
+          artifactName: nuget-signed
+          artifactPatterns: |
+            !*Darwin*
+          propsArtifactName: $(NuGetArtifactName)
+          signType: $(MicroBuildSignType)
+          use1ESTemplate: true
+          postConvertSteps:
+          - task: DownloadPipelineArtifact@2
+            inputs:
+              artifactName: $(NuGetArtifactName)
+              downloadPath: $(Build.StagingDirectory)\sign-verify
+              patterns: |
+                **/SignVerifyIgnore.txt
+
+          - task: MicroBuildCodesignVerify@3
+            displayName: verify signed msi content
+            inputs:
+              TargetFolders: |
+                $(Build.ArtifactStagingDirectory)\bin\manifests
+                $(Build.ArtifactStagingDirectory)\bin\manifests-multitarget
+              ExcludeSNVerify: true
+              ApprovalListPathForCerts: $(Build.StagingDirectory)\sign-verify\SignVerifyIgnore.txt
+
       # Check - "Xamarin.Android (Prepare .NET Release Push Internal)"
       - job: push_signed_nugets
         displayName: Push Internal
-        #dependsOn:
-        #- nuget_convert
-        #- sign_net_linux
-        #condition: and(eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.sign_net_linux.result, 'Succeeded'))
+        dependsOn:
+        - nuget_convert
+        - sign_net_linux
+        condition: and(eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.sign_net_linux.result, 'Succeeded'))
         timeoutInMinutes: 60
         pool: $(VSEngMicroBuildPool)
         workspace:
@@ -487,85 +537,65 @@ extends:
         variables:
         - ${{ if eq(variables['MicroBuildSignType'], 'Real') }}:
           - group: Publish-Build-Assets
-        templateContext:
-          outputs:
-          - output: nuget
-            condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
-            useDotNetTask: false # The default is false to use the NuGetCommand task. Set to true to use the DotNetCoreCLI task to publish packages.
-            packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg
-            packageParentPath: $(Build.StagingDirectory)\nuget-signed
-            nuGetFeedType: external
-            publishFeedCredentials: $(DotNetFeedCredential)
         steps:
         - checkout: self
 
         - task: DownloadPipelineArtifact@2
           inputs:
-            buildType: specific
-            project: DevDiv
-            definition: 11410
-            pipelineId: 9568160
-            buildVersionToDownload: specific
-            allowPartiallySucceededBuilds: true
             artifactName: nuget-signed
             downloadPath: $(Build.StagingDirectory)\nuget-signed
 
-        #- task: DownloadPipelineArtifact@2
-        #  inputs:
-        #    artifactName: nuget-signed
-        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
-
-        #- task: DownloadPipelineArtifact@2
-        #  inputs:
-        #    artifactName: nuget-linux-signed
-        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
-
-        #- task: DownloadPipelineArtifact@2
-        #  inputs:
-        #    artifactName: vs-msi-nugets
-        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
-
-        #- task: DownloadPipelineArtifact@2
-        #  inputs:
-        #    artifactName: $(WindowsToolchainPdbArtifactName)
-        #    downloadPath: $(Build.StagingDirectory)\nuget-signed
-
-        #- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
-        #  parameters:
-        #    githubToken: $(GitHub.Token)
-        #    githubContext: $(NupkgCommitStatusName)
-        #    blobName: $(NupkgCommitStatusName)
-        #    packagePrefix: xamarin-android
-        #    artifactsPath: $(Build.StagingDirectory)\nuget-signed
-        #    yamlResourceName: yaml-templates
-
-        #- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
-        #  parameters:
-        #    githubToken: $(GitHub.Token)
-        #    githubContext: $(VSDropCommitStatusName)
-        #    blobName: $(VSDropCommitStatusName)
-        #    packagePrefix: xamarin-android
-        #    artifactsPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
-        #    yamlResourceName: yaml-templates
-        #    downloadSteps:
-        #    - task: DownloadPipelineArtifact@2
-        #      inputs:
-        #        artifactName: vsdrop-signed
-        #        downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
-
-        #- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
-        #  parameters:
-        #    githubToken: $(GitHub.Token)
-        #    githubContext: $(MultiTargetVSDropCommitStatusName)
-        #    blobName: $(MultiTargetVSDropCommitStatusName)
-        #    packagePrefix: xamarin-android
-        #    artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
-        #    yamlResourceName: yaml-templates
-        #    downloadSteps:
-        #    - task: DownloadPipelineArtifact@2
-        #      inputs:
-        #        artifactName: vsdrop-multitarget-signed
-        #        downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
+        - task: DownloadPipelineArtifact@2
+          inputs:
+            artifactName: nuget-linux-signed
+            downloadPath: $(Build.StagingDirectory)\nuget-signed
+
+        - task: DownloadPipelineArtifact@2
+          inputs:
+            artifactName: vs-msi-nugets
+            downloadPath: $(Build.StagingDirectory)\nuget-signed
+
+        - task: DownloadPipelineArtifact@2
+          inputs:
+            artifactName: $(WindowsToolchainPdbArtifactName)
+            downloadPath: $(Build.StagingDirectory)\nuget-signed
+
+        - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
+          parameters:
+            githubToken: $(GitHub.Token)
+            githubContext: $(NupkgCommitStatusName)
+            blobName: $(NupkgCommitStatusName)
+            packagePrefix: xamarin-android
+            artifactsPath: $(Build.StagingDirectory)\nuget-signed
+            yamlResourceName: yaml-templates
+
+        - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
+          parameters:
+            githubToken: $(GitHub.Token)
+            githubContext: $(VSDropCommitStatusName)
+            blobName: $(VSDropCommitStatusName)
+            packagePrefix: xamarin-android
+            artifactsPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
+            yamlResourceName: yaml-templates
+            downloadSteps:
+            - task: DownloadPipelineArtifact@2
+              inputs:
+                artifactName: vsdrop-signed
+                downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
+
+        - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
+          parameters:
+            githubToken: $(GitHub.Token)
+            githubContext: $(MultiTargetVSDropCommitStatusName)
+            blobName: $(MultiTargetVSDropCommitStatusName)
+            packagePrefix: xamarin-android
+            artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
+            yamlResourceName: yaml-templates
+            downloadSteps:
+            - task: DownloadPipelineArtifact@2
+              inputs:
+                artifactName: vsdrop-multitarget-signed
+                downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
 
         - powershell: >-
             & dotnet build -v:n -c $(XA.Build.Configuration)
@@ -575,16 +605,16 @@ extends:
             $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
             -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog
           displayName: generate and publish assets
-          #condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
-
-        #- powershell: |
-        #    $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/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) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
-        #  displayName: add build to default darc channel
-        #  condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
+          condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
+
+        - powershell: |
+            $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/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) --publishing-infra-version 3 --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
+          displayName: add build to default darc channel and feed
+          condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
 
         - template: build-tools\automation\yaml-templates\upload-results.yaml@self
           parameters:
diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index b6737cfc8de..c24841e9558 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -180,22 +180,10 @@
 
     <Error Condition="'@(ItemsToPush)' == ''" Text="No packages to push." />
 
-    <!--Error Condition="'$(BUILD_BUILDNUMBER)' == ''" Text="The BUILD_BUILDNUMBER property is required." />
-    <Error Condition="'$(ArtifactsLogDir)' == ''" Text="The ArtifactsLogDir property is required." />
-    <Error Condition="'$(BUILD_SOURCEBRANCH)' == ''" Text="The BUILD_SOURCEBRANCH property is required." />
-    <Error Condition="'$(BUILD_SOURCEVERSION)' == ''" Text="The BUILD_SOURCEVERSION property is required." />
-    <Error Condition="'$(BUILD_REPOSITORY_URI)' == ''" Text="The BUILD_REPOSITORY_URI property is required." />
-    <Error Condition="'$(MaestroAccessToken)' == ''" Text="The MaestroAccessToken property is required." />
-    <Error Condition="'$(MaestroApiEndpoint)' == ''" Text="The MaestroApiEndpoint property is required." />
-    <Error Condition="'$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)' == ''" Text="The SYSTEM_TEAMFOUNDATIONCOLLECTIONURI property is required." />
-    <Error Condition="'$(SYSTEM_TEAMPROJECT)' == ''" Text="The SYSTEM_TEAMPROJECT property is required." />
-    <Error Condition="'$(BUILD_BUILDID)' == ''" Text="The BUILD_BUILDID property is required." />
-    <Error Condition="'$(SYSTEM_DEFINITIONID)' == ''" Text="The SYSTEM_DEFINITIONID property is required." /-->
-
     <Message Text="Publishing %(ItemsToPush.Identity)" Importance="normal" />
 
     <ItemGroup>
-      <ManifestBuildData Include="InitialAssetsLocation=TODO" />
+      <ManifestBuildData Include="InitialAssetsLocation=" />
       <ManifestBuildData Include="AzureDevOpsBuildId=$(BUILD_BUILDID)" />
       <ManifestBuildData Include="AzureDevOpsBuildDefinitionId=$(SYSTEM_DEFINITIONID)" />
       <ManifestBuildData Include="AzureDevOpsProject=$(SYSTEM_TEAMPROJECT)" />
@@ -226,45 +214,6 @@
     />
   </Target>
 
-  <Target Name="PushManifestToBuildAssetRegistry" >
-    <ItemGroup>
-      <BuildArtifacts Include="$(OutputPath)*.nupkg" />
-    </ItemGroup>
-
-    <Error Condition="'@(BuildArtifacts)' == ''" Text="No packages to create manifest from." />
-
-    <ItemGroup>
-      <ManifestBuildData Include="InitialAssetsLocation=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
-      <ManifestBuildData Include="AzureDevOpsBuildId=$(BUILD_BUILDID)" />
-      <ManifestBuildData Include="AzureDevOpsBuildDefinitionId=$(SYSTEM_DEFINITIONID)" />
-      <ManifestBuildData Include="AzureDevOpsProject=$(SYSTEM_TEAMPROJECT)" />
-      <ManifestBuildData Include="AzureDevOpsBuildNumber=$(BUILD_BUILDNUMBER)" />
-      <ManifestBuildData Include="AzureDevOpsRepository=$(BUILD_REPOSITORY_URI)" />
-      <ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
-    </ItemGroup>
-
-    <GenerateBuildManifest
-        Artifacts="@(BuildArtifacts)"
-        OutputPath="$(OutputPath)bar-manifests\AssetManifest.xml"
-        BuildId="$(BUILD_BUILDNUMBER)"
-        BuildData="@(ManifestBuildData)"
-        RepoUri="$(BUILD_REPOSITORY_URI)"
-        RepoBranch="$(BUILD_SOURCEBRANCH)"
-        RepoCommit="$(BUILD_SOURCEVERSION)"
-        PublishingVersion="3" />
-
-    <MSBuild
-        Targets="Restore"
-        Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
-        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion)"
-    />
-
-    <MSBuild
-        Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
-        Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(OutputPath)bar-manifests;MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com"
-    />
-  </Target>
-
   <!-- Targets for setting up a local workload test environment without needing to pack .nupkg files -->
   <ItemGroup>
     <_FrameworkListInputs  Include="$(MicrosoftAndroidRefPackDir)**" />

From 3a5c5fef06ebff66971b00035dab0a05e2f33da3 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 21:01:53 -0700
Subject: [PATCH 13/17] Simplify diff

---
 build-tools/automation/azure-pipelines.yaml    |  6 +++---
 .../create-packs/Directory.Build.targets       | 18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index c2c2a4e75af..3a6e046479a 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -599,12 +599,12 @@ extends:
 
         - powershell: >-
             & dotnet build -v:n -c $(XA.Build.Configuration)
-            -t:PublishToBuildAssetRegistry
+            -t:PushManifestToBuildAssetRegistry
             -p:BuildAssetRegistryToken=$(MaestroAccessToken)
             -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
             $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
             -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog
-          displayName: generate and publish assets
+          displayName: generate and publish BAR manifest
           condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
 
         - powershell: |
@@ -613,7 +613,7 @@ extends:
             $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) --publishing-infra-version 3 --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
-          displayName: add build to default darc channel and feed
+          displayName: add build to default darc channel
           condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
 
         - template: build-tools\automation\yaml-templates\upload-results.yaml@self
diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index c24841e9558..be258aec345 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -165,7 +165,7 @@
   </Target>
 
   <!-- https://github.com/dotnet/arcade/blob/efc3da96e5ac110513e92ebd9ef87c73f44d8540/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
-  <Target Name="PublishToBuildAssetRegistry">
+  <Target Name="PushManifestToBuildAssetRegistry">
     <PropertyGroup>
       <ArtifactsLogDir>$(OutputPath)</ArtifactsLogDir>
       <AssetManifestFileName>Assets.xml</AssetManifestFileName>
@@ -193,14 +193,14 @@
     </ItemGroup>
 
     <PushToAzureDevOpsArtifacts
-      ItemsToPush="@(ItemsToPush)"
-      ManifestBuildData="@(ManifestBuildData)"
-      ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
-      ManifestBranch="$(BUILD_SOURCEBRANCH)"
-      ManifestBuildId="$(BUILD_BUILDNUMBER)"
-      ManifestCommit="$(BUILD_SOURCEVERSION)"
-      AssetManifestPath="$(AssetManifestPath)"
-      PublishingVersion="3" />
+        ItemsToPush="@(ItemsToPush)"
+        ManifestBuildData="@(ManifestBuildData)"
+        ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
+        ManifestBranch="$(BUILD_SOURCEBRANCH)"
+        ManifestBuildId="$(BUILD_BUILDNUMBER)"
+        ManifestCommit="$(BUILD_SOURCEVERSION)"
+        AssetManifestPath="$(AssetManifestPath)"
+        PublishingVersion="3" />
 
     <MSBuild
         Targets="Restore"

From 70a5c554afdfc109e54756556275d1a13689b51a Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 21:03:29 -0700
Subject: [PATCH 14/17] Simplify diff

---
 build-tools/create-packs/Directory.Build.targets | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index be258aec345..fc0168c1989 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -165,7 +165,7 @@
   </Target>
 
   <!-- https://github.com/dotnet/arcade/blob/efc3da96e5ac110513e92ebd9ef87c73f44d8540/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
-  <Target Name="PushManifestToBuildAssetRegistry">
+  <Target Name="PushManifestToBuildAssetRegistry" >
     <PropertyGroup>
       <ArtifactsLogDir>$(OutputPath)</ArtifactsLogDir>
       <AssetManifestFileName>Assets.xml</AssetManifestFileName>

From 6e8ad8755c225c64d67e2d7f319851b7dadcf92d Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Tue, 14 May 2024 21:29:47 -0700
Subject: [PATCH 15/17] Revert ApiCompat update

---
 eng/Version.Details.xml | 4 ++--
 eng/Versions.props      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 3f5e19a50d0..5c9c8982a94 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -22,9 +22,9 @@
     </Dependency>
   </ProductDependencies>
   <ToolsetDependencies>
-    <Dependency Name="Microsoft.DotNet.ApiCompat" Version="8.0.0-beta.24225.1">
+    <Dependency Name="Microsoft.DotNet.ApiCompat" Version="7.0.0-beta.22103.1">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>67d23f4ba1813b315e7e33c71d18b63475f5c5f8</Sha>
+      <Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
     </Dependency>
     <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24225.1">
       <Uri>https://github.com/dotnet/arcade</Uri>
diff --git a/eng/Versions.props b/eng/Versions.props
index 8005de583c4..71ef362497f 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -4,7 +4,7 @@
     <MicrosoftDotnetSdkInternalPackageVersion>9.0.100-preview.5.24253.16</MicrosoftDotnetSdkInternalPackageVersion>
     <MicrosoftNETILLinkTasksPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETILLinkTasksPackageVersion>
     <MicrosoftNETCoreAppRefPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETCoreAppRefPackageVersion>
-    <MicrosoftDotNetApiCompatPackageVersion>8.0.0-beta.24225.1</MicrosoftDotNetApiCompatPackageVersion>
+    <MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
     <MicrosoftDotNetBuildTasksFeedPackageVersion>8.0.0-beta.24225.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
     <MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-preview.5.24223.2</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
     <MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>

From decfdcd4d9f4effbdf10ac3ce13f9580ec0b60b3 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Wed, 15 May 2024 09:19:50 -0700
Subject: [PATCH 16/17] Use updated maestro url

---
 build-tools/automation/azure-pipelines.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index 3a6e046479a..e6ade1be56e 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -608,7 +608,7 @@ extends:
           condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
 
         - powershell: |
-            $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16'
+            $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

From 35bdb01f46e3f58da0347e2ae0f28984232e7cd0 Mon Sep 17 00:00:00 2001
From: Peter Collins <pecolli@microsoft.com>
Date: Wed, 15 May 2024 09:25:31 -0700
Subject: [PATCH 17/17] Remove unused task

---
 build-tools/create-packs/Directory.Build.targets | 1 -
 1 file changed, 1 deletion(-)

diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets
index fc0168c1989..ab7c12516f5 100644
--- a/build-tools/create-packs/Directory.Build.targets
+++ b/build-tools/create-packs/Directory.Build.targets
@@ -10,7 +10,6 @@
   <Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" Version="$(MicrosoftDotNetBuildTasksFeedPackageVersion)" />
 
   <UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetSharedFrameworkTaskFile)"/>
-  <UsingTask TaskName="GenerateBuildManifest" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
   <UsingTask TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" AssemblyFile="$(PrepTasksAssembly)" />
 
   <!-- https://github.com/dotnet/runtime/blob/0647ec314948904319da5eb15e9931f7c85ed1e2/src/installer/pkg/projects/Directory.Build.targets#L281 -->
