Move compliance check before publishing pipeline artifact (#17857)

### Description
<!-- Describe your changes. -->


### Motivation and Context
Compliance check would fail randomly but the stage couldn't be rerun if
the pipeline artifacts are already published.
There's the error like `Artifact xxxx already exists`.
We had to restart the whole pipeline if there's a random error in
compliance check.
This commit is contained in:
Yi Zhang 2023-10-12 15:48:04 +08:00 committed by GitHub
parent 74a8acf405
commit 9d07ca3621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,6 +231,15 @@ stages:
searchPattern: '**/*.pdb'
symbolServerType: teamServices
- ${{ if eq(parameters['DoCompliance'], 'true') }}:
- template: ../../templates/compliance.yml
parameters :
msbuildPlatform: ${{ parameters.sln_platform }}
- template: ../../templates/component-governance-component-detection-steps.yml
parameters :
condition : 'succeeded'
# Node.js Publish
- ${{ if eq(parameters['DoNodejsPack'], 'true') }}:
- task: BatchScript@1
@ -285,15 +294,6 @@ stages:
targetPath: '$(Build.SourcesDirectory)\js\node\bin\napi-v3\win32\${{ parameters.sln_platform }}'
artifactName: 'drop-onnxruntime-nodejs-win-${{ parameters.sln_platform }}-dml'
- ${{ if eq(parameters['DoCompliance'], 'true') }}:
- template: ../../templates/compliance.yml
parameters :
msbuildPlatform: ${{ parameters.sln_platform }}
- template: ../../templates/component-governance-component-detection-steps.yml
parameters :
condition : 'succeeded'
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()