Skip to content

Commit bbac9fe

Browse files
authored
[ci] Improve maestro artifact publishing (#8945)
Context: https://github.com/dotnet/arcade/blob/efc3da96e5ac110513e92ebd9ef87c73f44d8540/Documentation/DependencyFlowOnboardingWithoutArcade.md The steps used to publish build asset information to maestro have been updated. With the new `PushToAzureDevOpsArtifacts` task the build pipeline should now create all of the artifacts required for maestro artifact publishing. The `add-build-to-channel` darc command will now trigger a [Build Promotion Pipeline][0] that pushes build assets to the feed that corresponds to the maestro channel that is being updated. We should no longer need to push assets to various NuGet feeds in a separate step. [0]: https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=9577012&view=logs&j=ba23343f-f710-5af9-782d-5bd26b102304&t=c7a8693b-2f9c-5ea8-c909-cde9405ac2e1&l=238
1 parent 9cbf665 commit bbac9fe

File tree

4 files changed

+28
-27
lines changed

4 files changed

+28
-27
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,6 @@ extends:
537537
variables:
538538
- ${{ if eq(variables['MicroBuildSignType'], 'Real') }}:
539539
- group: Publish-Build-Assets
540-
templateContext:
541-
outputs:
542-
- output: nuget
543-
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
544-
useDotNetTask: false # The default is false to use the NuGetCommand task. Set to true to use the DotNetCoreCLI task to publish packages.
545-
packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg
546-
packageParentPath: $(Build.StagingDirectory)\nuget-signed
547-
nuGetFeedType: external
548-
publishFeedCredentials: $(DotNetFeedCredential)
549540
steps:
550541
- checkout: self
551542

@@ -617,11 +608,11 @@ extends:
617608
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
618609
619610
- powershell: |
620-
$versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16'
611+
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16'
621612
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
622613
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
623614
& dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n
624-
& $(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)
615+
& $(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)
625616
displayName: add build to default darc channel
626617
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
627618

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

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" Version="$(MicrosoftDotNetBuildTasksFeedPackageVersion)" />
1111

1212
<UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetSharedFrameworkTaskFile)"/>
13-
<UsingTask TaskName="GenerateBuildManifest" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
1413
<UsingTask TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" AssemblyFile="$(PrepTasksAssembly)" />
1514

1615
<!-- https://github.com/dotnet/runtime/blob/0647ec314948904319da5eb15e9931f7c85ed1e2/src/installer/pkg/projects/Directory.Build.targets#L281 -->
@@ -164,15 +163,26 @@
164163
<RemoveDir Directories="@(_PackFoldersToDelete)" />
165164
</Target>
166165

166+
<!-- https://github.com/dotnet/arcade/blob/efc3da96e5ac110513e92ebd9ef87c73f44d8540/Documentation/DependencyFlowOnboardingWithoutArcade.md -->
167167
<Target Name="PushManifestToBuildAssetRegistry" >
168+
<PropertyGroup>
169+
<ArtifactsLogDir>$(OutputPath)</ArtifactsLogDir>
170+
<AssetManifestFileName>Assets.xml</AssetManifestFileName>
171+
<AssetManifestPath>$(ArtifactsLogDir)AssetManifest\$(AssetManifestFileName)</AssetManifestPath>
172+
</PropertyGroup>
173+
174+
<Error Condition="Exists($(AssetManifestPath))" Text="The manifest file '$(AssetManifestPath)' already exists." />
175+
168176
<ItemGroup>
169-
<BuildArtifacts Include="$(OutputPath)*.nupkg" />
177+
<ItemsToPush Include="$(OutputPath)*.nupkg" />
170178
</ItemGroup>
171179

172-
<Error Condition="'@(BuildArtifacts)' == ''" Text="No packages to create manifest from." />
180+
<Error Condition="'@(ItemsToPush)' == ''" Text="No packages to push." />
181+
182+
<Message Text="Publishing %(ItemsToPush.Identity)" Importance="normal" />
173183

174184
<ItemGroup>
175-
<ManifestBuildData Include="InitialAssetsLocation=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
185+
<ManifestBuildData Include="InitialAssetsLocation=" />
176186
<ManifestBuildData Include="AzureDevOpsBuildId=$(BUILD_BUILDID)" />
177187
<ManifestBuildData Include="AzureDevOpsBuildDefinitionId=$(SYSTEM_DEFINITIONID)" />
178188
<ManifestBuildData Include="AzureDevOpsProject=$(SYSTEM_TEAMPROJECT)" />
@@ -181,14 +191,14 @@
181191
<ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
182192
</ItemGroup>
183193

184-
<GenerateBuildManifest
185-
Artifacts="@(BuildArtifacts)"
186-
OutputPath="$(OutputPath)bar-manifests\AssetManifest.xml"
187-
BuildId="$(BUILD_BUILDNUMBER)"
188-
BuildData="@(ManifestBuildData)"
189-
RepoUri="$(BUILD_REPOSITORY_URI)"
190-
RepoBranch="$(BUILD_SOURCEBRANCH)"
191-
RepoCommit="$(BUILD_SOURCEVERSION)"
194+
<PushToAzureDevOpsArtifacts
195+
ItemsToPush="@(ItemsToPush)"
196+
ManifestBuildData="@(ManifestBuildData)"
197+
ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
198+
ManifestBranch="$(BUILD_SOURCEBRANCH)"
199+
ManifestBuildId="$(BUILD_BUILDNUMBER)"
200+
ManifestCommit="$(BUILD_SOURCEVERSION)"
201+
AssetManifestPath="$(AssetManifestPath)"
192202
PublishingVersion="3" />
193203

194204
<MSBuild
@@ -199,7 +209,7 @@
199209

200210
<MSBuild
201211
Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
202-
Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(OutputPath)bar-manifests;MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com"
212+
Properties="Configuration=$(Configuration);RepoRoot=$(XamarinAndroidSourcePath);VersionPrefix=$(AndroidPackVersion);ManifestsPath=$(ArtifactsLogDir)AssetManifest;MaestroApiEndpoint=https://maestro.dot.net"
203213
/>
204214
</Target>
205215

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="7.0.0-beta.22103.1">
29+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24225.1">
3030
<Uri>https://github.com/dotnet/arcade</Uri>
31-
<Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
31+
<Sha>67d23f4ba1813b315e7e33c71d18b63475f5c5f8</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
@@ -5,7 +5,7 @@
55
<MicrosoftNETILLinkTasksPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETILLinkTasksPackageVersion>
66
<MicrosoftNETCoreAppRefPackageVersion>9.0.0-preview.4.24251.3</MicrosoftNETCoreAppRefPackageVersion>
77
<MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
8-
<MicrosoftDotNetBuildTasksFeedPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
8+
<MicrosoftDotNetBuildTasksFeedPackageVersion>8.0.0-beta.24225.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
99
<MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-preview.5.24223.2</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
1010
<MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>
1111
<MicrosoftTemplateEngineTasksPackageVersion>7.0.100-rc.1.22410.7</MicrosoftTemplateEngineTasksPackageVersion>

0 commit comments

Comments
 (0)