Skip to content

Commit 0473c75

Browse files
committed
[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 506b716 commit 0473c75

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
@@ -540,15 +540,6 @@ extends:
540540
variables:
541541
- ${{ if eq(variables['MicroBuildSignType'], 'Real') }}:
542542
- group: Publish-Build-Assets
543-
templateContext:
544-
outputs:
545-
- output: nuget
546-
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
547-
useDotNetTask: false # The default is false to use the NuGetCommand task. Set to true to use the DotNetCoreCLI task to publish packages.
548-
packagesToPush: $(Build.StagingDirectory)\nuget-signed\*.nupkg
549-
packageParentPath: $(Build.StagingDirectory)\nuget-signed
550-
nuGetFeedType: external
551-
publishFeedCredentials: $(DotNetFeedCredential)
552543
steps:
553544
- checkout: self
554545

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

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
@@ -30,9 +30,9 @@
3030
<Uri>https://github.com/dotnet/arcade</Uri>
3131
<Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
3232
</Dependency>
33-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="7.0.0-beta.22103.1">
33+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24225.1">
3434
<Uri>https://github.com/dotnet/arcade</Uri>
35-
<Sha>70831f0d126fe88b81d7dc8de11358e17a5ce364</Sha>
35+
<Sha>67d23f4ba1813b315e7e33c71d18b63475f5c5f8</Sha>
3636
</Dependency>
3737
<Dependency Name="Microsoft.TemplateEngine.Tasks" Version="7.0.100-rc.1.22410.7">
3838
<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>8.0.8</MicrosoftNETILLinkTasksPackageVersion>
77
<MicrosoftNETCoreAppRefPackageVersion>8.0.8</MicrosoftNETCoreAppRefPackageVersion>
88
<MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
9-
<MicrosoftDotNetBuildTasksFeedPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
9+
<MicrosoftDotNetBuildTasksFeedPackageVersion>8.0.0-beta.24225.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
1010
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version>8.0.8</MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version>
1111
<MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version)</MicrosoftNETWorkloadEmscriptenPackageVersion>
1212
<MicrosoftTemplateEngineTasksPackageVersion>7.0.100-rc.1.22410.7</MicrosoftTemplateEngineTasksPackageVersion>

0 commit comments

Comments
 (0)