Skip to content

Commit

Permalink
Use single publish task for publish artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
benbp authored and azure-sdk committed Mar 4, 2024
1 parent 66cf1b8 commit b209de3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions eng/common/pipelines/templates/steps/publish-1es-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ parameters:
ArtifactName: ''
ArtifactPath: ''
CustomCondition: true
DisplayName: 'Publish Artifacts'

steps:
- task: 1ES.PublishPipelineArtifact@1
- pwsh: |
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}"
condition: and(succeeded(), ${{ parameters.CustomCondition }})
displayName: '${{ parameters.DisplayName }} - ${{ parameters.ArtifactName }}'
inputs:
artifact: '${{ parameters.ArtifactName }}'
path: '${{ parameters.ArtifactPath }}'
displayName: Set Artifact Name
- task: 1ES.PublishPipelineArtifact@1
- pwsh: |
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt)"
condition: and(failed(), ${{ parameters.CustomCondition }})
displayName: 'Failed - ${{ parameters.DisplayName }} - ${{ parameters.ArtifactName }}'
displayName: Set Failed Artifact Name
- task: 1ES.PublishPipelineArtifact@1
condition: and(succeeded(), ${{ parameters.CustomCondition }})
displayName: 'Publish ${{ parameters.ArtifactName }} Artifacts'
inputs:
artifact: '${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt)'
artifact: '$(PublishArtifactName)'
path: '${{ parameters.ArtifactPath }}'

0 comments on commit b209de3

Please sign in to comment.