Skip to content

Commit 3bcd3eb

Browse files
[release/8.0.1xx-sr8] Backport maestro and artifact drop infra improvements from net9.0 (#24378)
* [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 * [ci] Use drop service for SDK insertion artifacts (#23658) Context: https://github.com/xamarin/yaml-templates/commit/8759ec9edd42953e1de21e3425f6dadca24faea9 Steps to upload release artifacts to custom blob storage have been replaced with azure-artifacts-drop (aka.ms/drop). A new version of nuget-msi-convert has been added that will create a set of artifact drops for the following shipping artifacts: * nugets * vs-components * vs-packs The nugets drop contains all shipping packages that should be pushed to various feeds or NuGet.org. The components and packs drops are used for VS insertions. * [ci] Simplify shipping drop metadata names (#24103) Using the $(System.JobAttempt) variable in the drop metadata artifact name is problematic. In some cases the drop artifacts created by the nuget-msi-convert job will be used by a different job, and the job attempt number will not necessarily match if any jobs are re-ran. * [ci] Use passwordless auth for darc/maestro (#24220) Fixes: #23974 Migrates darc/maestro commands to use a passwordless auth flow, as token based authentication is deprecated and will be removed in the future. * Update bar manifest build step * Update bar manifest build working dir * Use new task name * Run add build to channel outside sources dir --------- Co-authored-by: Peter Collins <[email protected]>
1 parent a659b18 commit 3bcd3eb

File tree

7 files changed

+78
-64
lines changed

7 files changed

+78
-64
lines changed

Diff for: eng/Version.Details.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
</Dependency>
1515
</ProductDependencies>
1616
<ToolsetDependencies>
17-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24310.5">
17+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.24408.2">
1818
<Uri>https://github.com/dotnet/arcade</Uri>
19-
<Sha>9f6799fdc16ae19b3e9478c55b997a6aab839d09</Sha>
19+
<Sha>60ae233c3d77f11c5fdb53e570b64d503b13ba59</Sha>
2020
</Dependency>
2121
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24310.5">
2222
<Uri>https://github.com/dotnet/arcade</Uri>

Diff for: eng/Versions.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<TizenUIExtensionsVersion>0.9.0</TizenUIExtensionsVersion>
115115
<ExCSSPackageVersion>4.2.3</ExCSSPackageVersion>
116116
<SystemDrawingCommonPackageVersion>8.0.3</SystemDrawingCommonPackageVersion>
117-
<MicrosoftDotNetBuildTasksFeedVersion>8.0.0-beta.24310.5</MicrosoftDotNetBuildTasksFeedVersion>
117+
<MicrosoftDotNetBuildTasksFeedVersion>9.0.0-beta.24408.2</MicrosoftDotNetBuildTasksFeedVersion>
118118
</PropertyGroup>
119119
<PropertyGroup>
120120
<MicrosoftNETTestSdkPackageVersion>17.6.0</MicrosoftNETTestSdkPackageVersion>

Diff for: eng/pipelines/common/sdk-insertion.yml

+65-53
Original file line numberDiff line numberDiff line change
@@ -5,80 +5,92 @@ parameters:
55
pushMauiPackagesToMaestro: false
66
nugetArtifactName: nuget-signed
77
nugetArtifactPath: $(Build.StagingDirectory)\nuget-signed
8+
dropRetentionDays: 120
89

910
jobs:
1011
- job: create_artifact_statuses
11-
displayName: Create GitHub Artifact Status and Push to Maestro
12+
displayName: Publish symbols and Push to Maestro
1213
timeoutInMinutes: 60
1314
pool:
1415
name: ${{ parameters.poolName }}
1516
image: ${{ parameters.vmImage }}
1617
os: ${{ parameters.os }}
17-
variables:
18-
- group: Publish-Build-Assets
18+
templateContext:
19+
outputs:
20+
- output: artifactsDrop
21+
dropServiceURI: https://devdiv.artifacts.visualstudio.com/DefaultCollection
22+
buildNumber: $(ReleaseDropPrefix)/symbols
23+
dropMetadataContainerName: DropMetadata-shipping-symbols
24+
sourcePath: $(Build.StagingDirectory)\symbols
25+
retentionDays: ${{ parameters.dropRetentionDays }}
26+
toLowerCase: false
1927
steps:
2028
- checkout: self
29+
30+
# Download symbols to be published to the symbols artifact drop declared above
2131
- task: DownloadPipelineArtifact@2
2232
inputs:
23-
artifactName: ${{ parameters.nugetArtifactName }}
24-
downloadPath: ${{ parameters.nugetArtifactPath }}
33+
artifactName: nuget
34+
downloadPath: $(Build.StagingDirectory)\symbols
2535
patterns: |
26-
*.nupkg
2736
**/*.snupkg
2837
**/additional-assets.zip
38+
displayName: Download symbols
39+
2940
- task: DownloadPipelineArtifact@2
3041
inputs:
31-
artifactName: vs-msi-nugets
32-
downloadPath: ${{ parameters.nugetArtifactPath }}
33-
- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
34-
parameters:
35-
githubToken: $(github--pat--vs-mobiletools-engineering-service2)
36-
githubContext: $(NupkgCommitStatusName)
37-
blobName: $(NupkgCommitStatusName)
38-
packagePrefix: maui
39-
artifactsPath: ${{ parameters.nugetArtifactPath }}
40-
yamlResourceName: yaml-templates
41-
- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
42-
parameters:
43-
githubToken: $(github--pat--vs-mobiletools-engineering-service2)
44-
githubContext: $(VSDropCommitStatusName)
45-
blobName: $(VSDropCommitStatusName)
46-
packagePrefix: maui
47-
artifactsPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName)
48-
yamlResourceName: yaml-templates
49-
downloadSteps:
50-
- task: DownloadPipelineArtifact@2
51-
inputs:
52-
artifactName: vsdrop-signed
53-
downloadPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName)
54-
- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
55-
parameters:
56-
githubToken: $(github--pat--vs-mobiletools-engineering-service2)
57-
githubContext: $(MultiTargetVSDropCommitStatusName)
58-
blobName: $(MultiTargetVSDropCommitStatusName)
59-
packagePrefix: maui
60-
artifactsPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName)
61-
yamlResourceName: yaml-templates
62-
downloadSteps:
63-
- task: DownloadPipelineArtifact@2
64-
inputs:
65-
artifactName: vsdrop-multitarget-signed
66-
downloadPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName)
67-
- task: DotNetCoreCLI@2
42+
artifactName: DropMetadata-shipping-nugets
43+
downloadPath: $(Build.StagingDirectory)\metadata
44+
displayName: Download nugets drop metadata
45+
46+
- powershell: |
47+
$jsonContent = Get-Content -Path "$(Build.StagingDirectory)\metadata\VSTSDrop.json" -Raw | ConvertFrom-Json
48+
$dropPrefix = $jsonContent.VstsDropBuildArtifact.VstsDropUrl -replace 'https://devdiv.artifacts.visualstudio.com/DefaultCollection/_apis/drop/drops/' -replace '/nugets'
49+
Write-Host "##vso[task.setvariable variable=ReleaseDropPrefix]$dropPrefix"
50+
displayName: Set variable ReleaseDropPrefix
51+
52+
# Download nugets drop created by nuget-msi-convert/job/v4.yml and publish to maestro
53+
- task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@1
54+
displayName: Download $(ReleaseDropPrefix)/nugets
55+
inputs:
56+
dropServiceURI: https://devdiv.artifacts.visualstudio.com/DefaultCollection
57+
buildNumber: $(ReleaseDropPrefix)/nugets
58+
destinationPath: ${{ parameters.nugetArtifactPath }}
59+
60+
- task: UseDotNet@2
61+
displayName: Install .NET 9.x
62+
inputs:
63+
version: 9.x
64+
includePreviewVersions: true
65+
66+
- task: AzureCLI@2
6867
displayName: Generate and publish BAR manifest
6968
inputs:
70-
projects: $(Build.SourcesDirectory)\src\Workload\Microsoft.Maui.Sdk\Microsoft.Maui.Sdk.csproj
71-
arguments: >-
69+
azureSubscription: "Darc: Maestro Production"
70+
scriptType: ps
71+
scriptLocation: inlineScript
72+
inlineScript: >-
73+
& dotnet build $(Build.SourcesDirectory)\src\Workload\Microsoft.Maui.Sdk\Microsoft.Maui.Sdk.csproj
7274
-t:PushManifestToBuildAssetRegistry
73-
-p:BuildAssetRegistryToken=$(MaestroAccessToken)
74-
-p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
75+
-p:OfficialBuildId=$(_BuildOfficalId)
76+
-p:OutputPath=${{ parameters.nugetArtifactPath }}
7577
-v:n -bl:$(Build.StagingDirectory)\binlogs\push-bar-manifest.binlog
78+
# Execute outside of the source directory to avoid any conflicting global.json file
79+
workingDirectory: $(Build.SourcesDirectory)\..
7680
condition: and(succeeded(), eq('${{ parameters.pushMauiPackagesToMaestro }}', 'true'))
77-
- powershell: |
78-
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16'
79-
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
80-
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
81-
& dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n
82-
& $(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)
81+
82+
- task: AzureCLI@2
83+
inputs:
84+
azureSubscription: "Darc: Maestro Production"
85+
scriptType: ps
86+
scriptLocation: inlineScript
87+
inlineScript: |
88+
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16'
89+
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
90+
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
91+
& dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n
92+
& $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --ci --publishing-infra-version 3 --azdev-pat $(System.AccessToken)
93+
# Execute outside of the source directory to avoid any conflicting global.json file
94+
workingDirectory: $(Build.SourcesDirectory)\..
8395
displayName: Add build to default darc channel
8496
condition: and(succeeded(), eq('${{ parameters.pushMauiPackagesToMaestro }}', 'true'))

Diff for: eng/pipelines/common/sign.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ stages:
2222
use1ESTemplate: true
2323
usePipelineArtifactTasks: true
2424

25-
- template: nuget-msi-convert/job/v3.yml@yaml-templates
25+
- template: nuget-msi-convert/job/v4.yml@yaml-templates
2626
parameters:
2727
yamlResourceName: yaml-templates
2828
artifactName: nuget-signed
@@ -42,7 +42,7 @@ stages:
4242
inputs:
4343
TargetFolders: |
4444
$(Build.ArtifactStagingDirectory)\bin\manifests
45-
$(Build.ArtifactStagingDirectory)\bin\manifests-multitarget
45+
$(Build.ArtifactStagingDirectory)\bin\manifests-packs
4646
$(Build.ArtifactStagingDirectory)\bin\msi-nupkgs
4747
ExcludeSNVerify: true
4848
ApprovalListPathForCerts: $(Build.ArtifactStagingDirectory)\sign-verify\SignVerifyIgnore.txt

Diff for: 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

Diff for: eng/pipelines/maui-release.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ extends:
144144
value: $(Build.SourcesDirectory)/build.cmd -ci
145145
- name: _BuildConfig
146146
value: Release
147-
- name: _BuildOfficalId
148-
value: $[ format('{0}.{1}', format('{0:yyyyMMdd}', pipeline.startTime), counter(format('{0:yyyyMMdd}', pipeline.startTime), 1) )]
149-
147+
150148
steps:
151149
- template: /eng/pipelines/common/pack.yml@self
152150
parameters:

Diff for: src/Workload/Shared/Maestro.targets

+5-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
3737
</ItemGroup>
3838

39-
<PushToAzureDevOpsArtifacts
39+
<PushToBuildStorage
4040
ItemsToPush="@(ItemsToPush)"
4141
IsStableBuild="$(StabilizePackageVersion)"
4242
ManifestBuildData="@(ManifestBuildData)"
@@ -47,15 +47,17 @@
4747
AssetManifestPath="$(AssetManifestPath)"
4848
PublishingVersion="3" />
4949

50+
<Message Text="BAR manifest version: $(PackageReferenceVersion)" />
51+
5052
<MSBuild
5153
Targets="Restore"
5254
Projects="$(PkgMicrosoft_DotNet_Arcade_Sdk)\tools\SdkTasks\PublishBuildAssets.proj"
53-
Properties="Configuration=$(Configuration);RepoRoot=$(MauiRootDirectory);VersionPrefix=$(Version)"
55+
Properties="Configuration=$(Configuration);RepoRoot=$(MauiRootDirectory);VersionPrefix=$(PackageReferenceVersion)"
5456
/>
5557

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

0 commit comments

Comments
 (0)