From 60a120636934ea839216f102d71d82eff8689f27 Mon Sep 17 00:00:00 2001 From: "Matt Mitchell (.NET)" Date: Wed, 25 Mar 2026 13:13:49 -0700 Subject: [PATCH] Upgrade to V4 arcade publishing - Add publishingVersion parameter to jobs.yml template - Rename enablePublishBuildAssets to enablePublishBuildToMaestro - Forward publishingVersion to publish-build-assets.yml - Set publishingVersion: 4 in eng/build.yml - Remove DotNetPublishUsingPipelines from build args - Add manifest gathering to job.yml for V4 pipeline artifacts - Add templateContext.outputs to publish artifacts including manifests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/Publishing.props | 1 + eng/build.yml | 3 +- eng/common-variables.yml | 2 - eng/common/core-templates/job/job.yml | 8 ++ eng/common/core-templates/jobs/jobs.yml | 5 + .../core-templates/post-build/post-build.yml | 111 +++++++++++++----- eng/common/templates-official/job/job.yml | 10 ++ 7 files changed, 106 insertions(+), 34 deletions(-) diff --git a/eng/Publishing.props b/eng/Publishing.props index fa47f5eb4b6..065b4af8b38 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -8,6 +8,7 @@ false + 4 diff --git a/eng/build.yml b/eng/build.yml index 2c7cb0452de..24b4e45c7ab 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -27,6 +27,7 @@ stages: microbuildUseESRP: ${{ parameters.microbuildUseESRP }} enableSourceIndex: true enableSourceBuild: true + publishingVersion: 4 workspace: clean: all jobs: @@ -62,7 +63,7 @@ stages: - template: /eng/common/templates-official/post-build/post-build.yml@self parameters: - publishingInfraVersion: 3 + publishingInfraVersion: 4 # signing validation will not run, even if the below value is 'true', if the 'PostBuildSign' variable is set to 'true' enableSigningValidation: false # Sourcelink validation isn't passing for Arcade due to some regressions. This should be diff --git a/eng/common-variables.yml b/eng/common-variables.yml index 4892a24959c..28da5202913 100644 --- a/eng/common-variables.yml +++ b/eng/common-variables.yml @@ -28,11 +28,9 @@ variables: - group: Publish-Build-Assets - group: DotNet-HelixApi-Access - group: SDL_Settings - # DotNetPublishUsingPipelines can be removed when Arcade itself consumes a new Arcade version. - name: _InternalBuildArgs value: /p:DotNetSignType=${{ parameters.signType }} /p:TeamName=$(_TeamName) - /p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER) - name: PostBuildSign value: true diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml index 748c4f07a64..ffdcce0eeee 100644 --- a/eng/common/core-templates/job/job.yml +++ b/eng/common/core-templates/job/job.yml @@ -203,6 +203,14 @@ jobs: SourceFolder: 'artifacts/packages' Contents: '**' TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/packages' + - ${{ if and(ne(parameters.artifacts.publish.manifests, 'false'), ne(parameters.artifacts.publish.manifests, '')) }}: + - task: CopyFiles@2 + displayName: Gather manifests for publish to artifacts + inputs: + SourceFolder: 'artifacts/log' + Contents: '**/AssetManifest/**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/manifests' + continueOnError: true - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - task: CopyFiles@2 displayName: Gather logs for publish to artifacts diff --git a/eng/common/core-templates/jobs/jobs.yml b/eng/common/core-templates/jobs/jobs.yml index 01ada747665..cc8cce45278 100644 --- a/eng/common/core-templates/jobs/jobs.yml +++ b/eng/common/core-templates/jobs/jobs.yml @@ -43,6 +43,10 @@ parameters: artifacts: {} is1ESPipeline: '' + + # Publishing version w/default. + publishingVersion: 3 + repositoryAlias: self officialBuildId: '' @@ -102,6 +106,7 @@ jobs: parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} continueOnError: ${{ parameters.continueOnError }} + publishingVersion: ${{ parameters.publishingVersion }} dependsOn: - ${{ if ne(parameters.publishBuildAssetsDependsOn, '') }}: - ${{ each job in parameters.publishBuildAssetsDependsOn }}: diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index c5ece185006..27edba02a95 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -9,6 +9,7 @@ parameters: default: 3 values: - 3 + - 4 - name: BARBuildId displayName: BAR Build Id @@ -130,16 +131,30 @@ stages: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true + - ${{ if ne(parameters.publishingInfraVersion, 4) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: specific + buildVersionToDownload: specific + project: $(AzDOProjectName) + pipeline: $(AzDOPipelineId) + buildId: $(AzDOBuildId) + artifactName: PackageArtifacts + checkDownloadedFiles: true + - ${{ if eq(parameters.publishingInfraVersion, 4) }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifacts (V4) + inputs: + itemPattern: '*/packages/**/*.nupkg' + targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + - task: CopyFiles@2 + displayName: Flatten packages to PackageArtifacts + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + Contents: '**/*.nupkg' + TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' + flattenFolders: true - task: PowerShell@2 displayName: Validate @@ -173,16 +188,30 @@ stages: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true + - ${{ if ne(parameters.publishingInfraVersion, 4) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: specific + buildVersionToDownload: specific + project: $(AzDOProjectName) + pipeline: $(AzDOPipelineId) + buildId: $(AzDOBuildId) + artifactName: PackageArtifacts + checkDownloadedFiles: true + - ${{ if eq(parameters.publishingInfraVersion, 4) }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifacts (V4) + inputs: + itemPattern: '*/packages/**/*.nupkg' + targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + - task: CopyFiles@2 + displayName: Flatten packages to PackageArtifacts + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + Contents: '**/*.nupkg' + TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' + flattenFolders: true # This is necessary whenever we want to publish/restore to an AzDO private feed # Since sdk-task.ps1 tries to restore packages we need to do this authentication here @@ -234,16 +263,30 @@ stages: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: BlobArtifacts - checkDownloadedFiles: true + - ${{ if ne(parameters.publishingInfraVersion, 4) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: specific + buildVersionToDownload: specific + project: $(AzDOProjectName) + pipeline: $(AzDOPipelineId) + buildId: $(AzDOBuildId) + artifactName: BlobArtifacts + checkDownloadedFiles: true + - ${{ if eq(parameters.publishingInfraVersion, 4) }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifacts (V4) + inputs: + itemPattern: '*/assets/**' + targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + - task: CopyFiles@2 + displayName: Flatten assets to BlobArtifacts + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + Contents: '**/*' + TargetFolder: '$(Build.ArtifactStagingDirectory)/BlobArtifacts' + flattenFolders: true - task: PowerShell@2 displayName: Validate @@ -268,6 +311,12 @@ stages: - template: /eng/common/core-templates/variables/pool-providers.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} + - ${{ if ge(parameters.publishingInfraVersion, 4) }}: + - name: _DarcPublishingInfraVersion + value: 3 + - ${{ else }}: + - name: _DarcPublishingInfraVersion + value: ${{ parameters.publishingInfraVersion }} jobs: - job: displayName: Publish Using Darc @@ -317,7 +366,7 @@ stages: scriptPath: $(System.DefaultWorkingDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: > -BuildId $(BARBuildId) - -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} + -PublishingInfraVersion $(_DarcPublishingInfraVersion) -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -RequireDefaultChannels ${{ parameters.requireDefaultChannels }} diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 92a0664f564..1d4b7199e7c 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -68,6 +68,16 @@ jobs: targetPath: $(Build.ArtifactStagingDirectory)/sbom artifactName: $(ARTIFACT_NAME) + # V4 publishing: automatically publish staged artifacts as a pipeline artifact. + # The artifact name matches the SDK's FutureArtifactName ($(System.PhaseName)_Artifacts), + # which is encoded in the asset manifest for downstream publishing to discover. + - ${{ if eq(parameters.publishingVersion, 4) }}: + - output: pipelineArtifact + displayName: 'Publish V4 pipeline artifacts' + targetPath: '$(Build.ArtifactStagingDirectory)/artifacts' + artifactName: '$(System.PhaseName)_Artifacts' + continueOnError: true + # add any outputs provided via root yaml - ${{ if ne(parameters.templateContext.outputs, '') }}: - ${{ each output in parameters.templateContext.outputs }}: