Improve Nuget-CUDA-Packaging-Pipeline (#19668)

### Description
<!-- Describe your changes. -->
* Publish the artifacts as late as possible
* once published the artifacts are immutable, and any retry will fail if
they exist
  * if any step fails after publishing the stage cannot be retried
* use powershell to cleanup
  * DeleteFiles is taking >30 mins and causing the stage to timeout
  * powershell took < 1s

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Make pipeline more robust
This commit is contained in:
Scott McKay 2024-02-28 03:27:43 +10:00 committed by GitHub
parent 580ee20dfc
commit 1c468a03b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 12 deletions

View file

@ -213,13 +213,6 @@ stages:
PlatformsSupported: 'linux-x64'
VerifyNugetSigning: false
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline NuGet Artifact'
inputs:
artifactName: 'drop-signed-nuget-GPU'
targetPath: '$(Build.ArtifactStagingDirectory)'
- task: MSBuild@1
displayName: 'Clean C#'
inputs:
@ -241,6 +234,12 @@ stages:
parameters:
condition: 'succeeded'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline NuGet Artifact'
inputs:
artifactName: 'drop-signed-nuget-GPU'
targetPath: '$(Build.ArtifactStagingDirectory)'
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()

View file

@ -6,11 +6,8 @@ parameters:
steps:
- ${{ if eq(variables['System.TeamProject'], 'Lotus') }}:
- task: DeleteFiles@1
inputs:
SourceFolder: '$(Build.BinariesDirectory)'
contents: |
**/*
- powershell: |
Remove-Item $(Build.BinariesDirectory)/* -Recurse -Force
displayName: 'Clean up build directory'
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0