Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PropertyGroup>
<!-- Do not auto-generate symbol packages. Arcade embeds all PDBs so it's just waste of space -->
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
<PublishingVersion>4</PublishingVersion>
</PropertyGroup>

</Project>
5 changes: 3 additions & 2 deletions eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ stages:
publish:
artifacts: true
logs: true
manifests: true
enableMicrobuild: true
microbuildUseESRP: ${{ parameters.microbuildUseESRP }}
enablePublishBuildAssets: true
enableSourceIndex: true
enableSourceBuild: true
publishingVersion: 4
workspace:
clean: all
jobs:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions eng/common-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions eng/common/core-templates/jobs/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ parameters:

artifacts: {}
is1ESPipeline: ''

# Publishing version w/default.
publishingVersion: 3

repositoryAlias: self
officialBuildId: ''

Expand Down Expand Up @@ -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 }}:
Expand Down
105 changes: 74 additions & 31 deletions eng/common/core-templates/post-build/post-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ parameters:
default: 3
values:
- 3
- 4

- name: BARBuildId
displayName: BAR Build Id
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) }}:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can use if/else in yaml

- 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -317,7 +360,7 @@ stages:
scriptPath: $(System.DefaultWorkingDirectory)/eng/common/post-build/publish-using-darc.ps1
arguments: >
-BuildId $(BARBuildId)
-PublishingInfraVersion ${{ parameters.publishingInfraVersion }}
-PublishingInfraVersion 3
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we hardcoding 3 here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because publishing is agnostic to the publishing infra version (e.g. VMR build passes 3). It just works transparently for v3/v4.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to remove the parameter in another PR

-AzdoToken '$(System.AccessToken)'
-WaitPublishingFinish true
-RequireDefaultChannels ${{ parameters.requireDefaultChannels }}
Expand Down
10 changes: 10 additions & 0 deletions eng/common/templates-official/job/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,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 }}:
Expand Down
Loading