Upload map files to specific artifact locations (#3229)

* Require success to upload map files

* Use a different artifact name for each attempt

* Agent.JobAttempt -> System.JobAttempt, add some display names
This commit is contained in:
Daniel Jurek 2022-01-10 15:25:32 -08:00 committed by GitHub
parent 8978973ddd
commit afe34f63ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,9 +202,10 @@ jobs:
condition: and(succeededOrFailed(), eq(variables['CODE_COVERAGE'], 'enabled'), eq(variables['Skip.BranchCoverageEnforcement'], ''))
# Use the job name to create the artifact name for MAP file publishing.
# "Validate Windows2019_UWP_debug_x86" -> "Windows2019_UWP_debug_x86"
# Attempts are also noted starting with 1
# "Validate Windows2019_UWP_debug_x86" -> "Windows2019_UWP_debug_x86_attempt_1"
- pwsh: |
$artifactName = '$(Agent.JobName)'
$artifactName = "$(Agent.JobName)_attempt_$(System.JobAttempt)"
$parts = $artifactName -split ' '
if ($parts[1]) {
$artifactName = $parts[1]
@ -219,9 +220,11 @@ jobs:
targetFolder: $(Build.ArtifactStagingDirectory)
flattenFolders: true
condition: eq(variables['PublishMapFiles'], 'true')
displayName: Stage map files
- task: PublishPipelineArtifact@1
inputs:
artifactName: map-files-$(MapFileArtifactName)
path: $(Build.ArtifactStagingDirectory)
condition: eq(variables['PublishMapFiles'], 'true')
condition: eq(variables['PublishMapFiles'], 'true')
displayName : Publish map file artifacts