Skip to content

Commit 45ce0ef

Browse files
mmitcheCopilotlbussell
authored
Update Arcade and adopt V4 publishing (#2069)
## Summary - update the Arcade SDK to `11.0.0-beta.26204.2` - add repo-owned `PublishingVersion` 4 configuration - switch the package-build job template to V4 `publishingVersion` / `enablePublishing` - remove the obsolete symbol-server token plumbing from the repo-owned build arguments ## Validation - parsed the updated Azure Pipelines YAML with PyYAML Related to dotnet/arcade#16697. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Logan Bussell <loganbussell@microsoft.com>
1 parent a719e44 commit 45ce0ef

11 files changed

Lines changed: 26 additions & 98 deletions

File tree

eng/Publishing.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<PublishingVersion>4</PublishingVersion>
4+
</PropertyGroup>
5+
</Project>

eng/Version.Details.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file should be imported by eng/Versions.props
66
<Project>
77
<PropertyGroup>
88
<!-- dotnet-arcade dependencies -->
9-
<MicrosoftDotNetArcadeSdkPackageVersion>11.0.0-beta.26181.7</MicrosoftDotNetArcadeSdkPackageVersion>
9+
<MicrosoftDotNetArcadeSdkPackageVersion>11.0.0-beta.26204.2</MicrosoftDotNetArcadeSdkPackageVersion>
1010
</PropertyGroup>
1111
<!--Property group for alternate package version names-->
1212
<PropertyGroup>

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.26181.7">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.26204.2">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>3294c57354d5d24eaa6aca9461635ab317163968</Sha>
8+
<Sha>c1c7d910b2fb388d2e458282f5cde711115f99c1</Sha>
99
</Dependency>
1010
</ToolsetDependencies>
1111
</Dependencies>

eng/common/core-templates/job/job.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ parameters:
2626
enablePublishBuildArtifacts: false
2727
enablePublishBuildAssets: false
2828
enablePublishTestResults: false
29+
enablePublishing: false
2930
enableBuildRetry: false
3031
mergeTestResults: false
3132
testRunTitle: ''

eng/common/core-templates/job/publish-build-assets.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ jobs:
173173
artifactName: AssetManifests
174174
displayName: 'Publish Merged Manifest'
175175
retryCountOnTaskFailure: 10 # for any files being locked
176+
isProduction: false # just metadata for publishing
176177

177178
- template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml
178179
parameters:
@@ -182,6 +183,7 @@ jobs:
182183
targetPath: '$(Build.StagingDirectory)/ReleaseConfigs'
183184
artifactName: ReleaseConfigs
184185
retryCountOnTaskFailure: 10 # for any files being locked
186+
isProduction: false # just metadata for publishing
185187

186188
- ${{ if or(eq(parameters.publishAssetsImmediately, 'true'), eq(parameters.isAssetlessBuild, 'true')) }}:
187189
- template: /eng/common/core-templates/post-build/setup-maestro-vars.yml

eng/common/sdk-task.ps1

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,7 @@ try {
6666

6767
if( $msbuildEngine -eq "vs") {
6868
# Ensure desktop MSBuild is available for sdk tasks.
69-
if( -not ($GlobalJson.tools.PSObject.Properties.Name -contains "vs" )) {
70-
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
71-
}
72-
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
73-
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "18.0.0" -MemberType NoteProperty
74-
}
75-
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
76-
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
77-
}
78-
if ($xcopyMSBuildToolsFolder -eq $null) {
79-
throw 'Unable to get xcopy downloadable version of msbuild'
80-
}
81-
82-
$global:_MSBuildExe = "$($xcopyMSBuildToolsFolder)\MSBuild\Current\Bin\MSBuild.exe"
69+
$global:_MSBuildExe = InitializeVisualStudioMSBuild
8370
}
8471

8572
$taskProject = GetSdkTaskProject $task

eng/common/templates-official/job/job.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ jobs:
6363
# V4 publishing: automatically publish staged artifacts as a pipeline artifact.
6464
# The artifact name matches the SDK's FutureArtifactName ($(System.PhaseName)_Artifacts),
6565
# which is encoded in the asset manifest for downstream publishing to discover.
66-
- ${{ if eq(parameters.publishingVersion, 4) }}:
66+
# Jobs can opt in by setting enablePublishing: true.
67+
- ${{ if and(eq(parameters.publishingVersion, 4), eq(parameters.enablePublishing, 'true')) }}:
6768
- output: pipelineArtifact
6869
displayName: 'Publish V4 pipeline artifacts'
6970
targetPath: '$(Build.ArtifactStagingDirectory)/artifacts'

eng/common/templates-official/steps/publish-pipeline-artifacts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ steps:
2424
artifactName: ${{ parameters.args.artifactName }}
2525
${{ if parameters.args.properties }}:
2626
properties: ${{ parameters.args.properties }}
27-
${{ if parameters.args.sbomEnabled }}:
27+
${{ if ne(parameters.args.sbomEnabled, '') }}:
2828
sbomEnabled: ${{ parameters.args.sbomEnabled }}
29-
${{ if parameters.args.isProduction }}:
29+
${{ if ne(parameters.args.isProduction, '') }}:
3030
isProduction: ${{ parameters.args.isProduction }}

eng/common/tools.ps1

Lines changed: 6 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,11 @@ function InstallDotNet([string] $dotnetRoot,
375375
#
376376
# 1. MSBuild from an active VS command prompt
377377
# 2. MSBuild from a compatible VS installation
378-
# 3. MSBuild from the xcopy tool package
379378
#
380379
# Returns full path to msbuild.exe.
381380
# Throws on failure.
382381
#
383-
function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $null) {
382+
function InitializeVisualStudioMSBuild([object]$vsRequirements = $null) {
384383
if (-not (IsWindowsPlatform)) {
385384
throw "Cannot initialize Visual Studio on non-Windows"
386385
}
@@ -390,13 +389,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
390389
}
391390

392391
# Minimum VS version to require.
393-
$vsMinVersionReqdStr = '17.7'
394-
$vsMinVersionReqd = [Version]::new($vsMinVersionReqdStr)
395-
396-
# If the version of msbuild is going to be xcopied,
397-
# use this version. Version matches a package here:
398-
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/18.0.0
399-
$defaultXCopyMSBuildVersion = '18.0.0'
392+
$vsMinVersionReqdStr = '18.0'
400393

401394
if (!$vsRequirements) {
402395
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {
@@ -426,46 +419,16 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
426419
}
427420
}
428421

429-
# Locate Visual Studio installation or download x-copy msbuild.
422+
# Locate Visual Studio installation.
430423
$vsInfo = LocateVisualStudio $vsRequirements
431-
if ($vsInfo -ne $null -and $env:ForceUseXCopyMSBuild -eq $null) {
424+
if ($vsInfo -ne $null) {
432425
# Ensure vsInstallDir has a trailing slash
433426
$vsInstallDir = Join-Path $vsInfo.installationPath "\"
434427
$vsMajorVersion = $vsInfo.installationVersion.Split('.')[0]
435428

436429
InitializeVisualStudioEnvironmentVariables $vsInstallDir $vsMajorVersion
437430
} else {
438-
if (Get-Member -InputObject $GlobalJson.tools -Name 'xcopy-msbuild') {
439-
$xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild'
440-
$vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0]
441-
} else {
442-
#if vs version provided in global.json is incompatible (too low) then use the default version for xcopy msbuild download
443-
if($vsMinVersion -lt $vsMinVersionReqd){
444-
Write-Host "Using xcopy-msbuild version of $defaultXCopyMSBuildVersion since VS version $vsMinVersionStr provided in global.json is not compatible"
445-
$xcopyMSBuildVersion = $defaultXCopyMSBuildVersion
446-
$vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0]
447-
}
448-
else{
449-
# If the VS version IS compatible, look for an xcopy msbuild package
450-
# with a version matching VS.
451-
# Note: If this version does not exist, then an explicit version of xcopy msbuild
452-
# can be specified in global.json. This will be required for pre-release versions of msbuild.
453-
$vsMajorVersion = $vsMinVersion.Major
454-
$vsMinorVersion = $vsMinVersion.Minor
455-
$xcopyMSBuildVersion = "$vsMajorVersion.$vsMinorVersion.0"
456-
}
457-
}
458-
459-
$vsInstallDir = $null
460-
if ($xcopyMSBuildVersion.Trim() -ine "none") {
461-
$vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install
462-
if ($vsInstallDir -eq $null) {
463-
throw "Could not xcopy msbuild. Please check that package 'Microsoft.DotNet.Arcade.MSBuild.Xcopy @ $xcopyMSBuildVersion' exists on feed 'dotnet-eng'."
464-
}
465-
}
466-
if ($vsInstallDir -eq $null) {
467-
throw 'Unable to find Visual Studio that has required version and components installed'
468-
}
431+
throw 'Unable to find Visual Studio that has required version and components installed'
469432
}
470433

471434
$msbuildVersionDir = if ([int]$vsMajorVersion -lt 16) { "$vsMajorVersion.0" } else { "Current" }
@@ -492,38 +455,6 @@ function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [str
492455
}
493456
}
494457

495-
function InstallXCopyMSBuild([string]$packageVersion) {
496-
return InitializeXCopyMSBuild $packageVersion -install $true
497-
}
498-
499-
function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
500-
$packageName = 'Microsoft.DotNet.Arcade.MSBuild.Xcopy'
501-
$packageDir = Join-Path $ToolsDir "msbuild\$packageVersion"
502-
$packagePath = Join-Path $packageDir "$packageName.$packageVersion.nupkg"
503-
504-
if (!(Test-Path $packageDir)) {
505-
if (!$install) {
506-
return $null
507-
}
508-
509-
Create-Directory $packageDir
510-
511-
Write-Host "Downloading $packageName $packageVersion"
512-
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
513-
Retry({
514-
Invoke-WebRequest "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/flat2/$packageName/$packageVersion/$packageName.$packageVersion.nupkg" -UseBasicParsing -OutFile $packagePath
515-
})
516-
517-
if (!(Test-Path $packagePath)) {
518-
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "See https://dev.azure.com/dnceng/internal/_wiki/wikis/DNCEng%20Services%20Wiki/1074/Updating-Microsoft.DotNet.Arcade.MSBuild.Xcopy-WAS-RoslynTools.MSBuild-(xcopy-msbuild)-generation?anchor=troubleshooting for help troubleshooting issues with XCopy MSBuild"
519-
throw
520-
}
521-
Unzip $packagePath $packageDir
522-
}
523-
524-
return Join-Path $packageDir 'tools'
525-
}
526-
527458
#
528459
# Locates Visual Studio instance that meets the minimal requirements specified by tools.vs object in global.json.
529460
#
@@ -633,7 +564,7 @@ function InitializeBuildTool() {
633564
$buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'net' }
634565
} elseif ($msbuildEngine -eq "vs") {
635566
try {
636-
$msbuildPath = InitializeVisualStudioMSBuild -install:$restore
567+
$msbuildPath = InitializeVisualStudioMSBuild
637568
} catch {
638569
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
639570
ExitWithExitCode 1

eng/pipelines/templates/jobs/build-and-publish-packages.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ jobs:
2626
enableMicrobuild: false
2727
enablePublishBuildArtifacts: ${{ parameters.enablePublish }}
2828
enablePublishBuildAssets: ${{ parameters.enablePublish }}
29+
# Keep this in sync with PublishingVersion in eng/Publishing.props
30+
publishingVersion: 4
2931
enableTelemetry: true
3032

3133
jobs:
3234
- job: Linux
35+
enablePublishing: ${{ parameters.enablePublish }}
3336
container: LinuxContainer
3437
pool:
3538
name: $(PoolProvider)
@@ -49,8 +52,6 @@ jobs:
4952
--prepareMachine
5053
-p:OfficialBuildId=$(Build.BuildNumber)
5154
-p:DotNetSignType=$(_SignType)
52-
-p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
53-
-p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
5455
displayName: Unix Build / Publish
5556
- task: ComponentGovernanceComponentDetection@0
5657
displayName: Component Governance scan

0 commit comments

Comments
 (0)