Skip to content

Commit 5b6db39

Browse files
authored
[ci] Set OfficialBuildId when building asset manifests (#23102)
Context: 812807c The maestro build promotion step has been failing with: PublishArtifactsInManifest.proj(130,5): error : Asset 'D:\a\_work\1\a\3fecf55a-18fb-414d-b980-84c0f56a3856\MergedManifest.xml' already exists with different contents at 'https://dotnetbuilds.blob.core.windows.net/public/assets/manifests/dotnet-maui/9.0.0-ci-dev/MergedManifest.xml' The manifest version information passed to the `PublishBuildAssets.proj` build does not contain revision information, causing asset publishing to fail as it will not overwrite existing assets with the same version. We should be able to fix this by setting the `OfficialBuildId` property when building the asset manifests, similar to what is currently being done when [packing the NuGets][0]. [0]: https://github.com/dotnet/maui/blob/5d3e788f297098417f6c603e5187fb24a37dda63/eng/cake/dotnet.cake#L285
1 parent 4ca773f commit 5b6db39

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

eng/pipelines/common/sdk-insertion.yml

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
projects: $(Build.SourcesDirectory)\src\Workload\Microsoft.Maui.Sdk\Microsoft.Maui.Sdk.csproj
7979
arguments: >-
8080
-t:PushManifestToBuildAssetRegistry
81+
-p:OfficialBuildId=$(_BuildOfficalId)
8182
-p:BuildAssetRegistryToken=$(MaestroAccessToken)
8283
-p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
8384
-v:n -bl:$(Build.StagingDirectory)\binlogs\push-bar-manifest.binlog

eng/pipelines/common/variables.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
variables:
22
- name: BuildVersion
33
value: $[counter('buildversion-counter', 5000)]
4+
- name: _BuildOfficalId
5+
value: $[ format('{0}.{1}', format('{0:yyyyMMdd}', pipeline.startTime), counter(format('{0:yyyyMMdd}', pipeline.startTime), 1) )]
46
- name: NUGET_VERSION
57
value: 6.4.0
68
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE

eng/pipelines/maui-release.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ extends:
137137
value: $(Build.SourcesDirectory)/build.cmd -ci
138138
- name: _BuildConfig
139139
value: Release
140-
- name: _BuildOfficalId
141-
value: $[ format('{0}.{1}', format('{0:yyyyMMdd}', pipeline.startTime), counter(format('{0:yyyyMMdd}', pipeline.startTime), 1) )]
142-
140+
143141
steps:
144142
- template: /eng/pipelines/common/pack.yml@self
145143
parameters:

src/Workload/Shared/Maestro.targets

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@
4848
AssetManifestPath="$(AssetManifestPath)"
4949
PublishingVersion="3" />
5050

51+
<Message Text="BAR manifest version: $(PackageReferenceVersion)" />
52+
5153
<MSBuild
5254
Targets="Restore"
5355
Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
54-
Properties="Configuration=$(Configuration);RepoRoot=$(MauiRootDirectory);VersionPrefix=$(Version)"
56+
Properties="Configuration=$(Configuration);RepoRoot=$(MauiRootDirectory);VersionPrefix=$(PackageReferenceVersion)"
5557
/>
5658

5759
<MSBuild
5860
Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
59-
Properties="Configuration=$(Configuration);RepoRoot=$(MauiRootDirectory);VersionPrefix=$(Version);ManifestsPath=$(ArtifactsLogDir)AssetManifest;MaestroApiEndpoint=https://maestro.dot.net"
61+
Properties="Configuration=$(Configuration);RepoRoot=$(MauiRootDirectory);VersionPrefix=$(PackageReferenceVersion);ManifestsPath=$(ArtifactsLogDir)AssetManifest;MaestroApiEndpoint=https://maestro.dot.net"
6062
/>
6163
</Target>
6264

0 commit comments

Comments
 (0)