diff --git a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml index 17af0d9480..a6ae0eddc6 100644 --- a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml +++ b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml @@ -24,6 +24,17 @@ parameters: type: boolean default: false +# these 2 parameters are used for debugging. +- name: SpecificArtifact + displayName: Use Specific Artifact (Debugging only) + type: boolean + default: false + +- name: BuildId + displayName: Pipeline BuildId, you could find it in the URL + type: string + default: '0' + resources: repositories: - repository: onnxruntime-inference-examples # The name used to reference this repository in the checkout step @@ -36,6 +47,12 @@ resources: name: pypa/manylinux ref: aead4d751c2101e23336aa73f2380df83e7a13f3 +variables: + - name: specificArtifact + value: ${{ parameters.SpecificArtifact }} + - name: otherRunId + value: ${{ parameters.BuildId }} + stages: - template: templates/c-api-cpu.yml parameters: @@ -151,24 +168,21 @@ stages: submodules: false - template: templates/set-version-number-variables-step.yml - - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact - Win x64' - inputs: - buildType: 'current' + - template: templates/flex-downloadPipelineArtifact.yml + parameters: + stepName: 'Download Pipeline Artifact - Win x64' artifactName: 'drop-onnxruntime-java-win-x64-tensorrt' targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-win-x64' - - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact - Linux x64' - inputs: - buildType: 'current' + - template: templates/flex-downloadPipelineArtifact.yml + parameters: + stepName: 'Download Pipeline Artifact - Linux x64' artifactName: 'drop-onnxruntime-java-linux-x64-cuda' targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-linux-x64' - - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact - Linux x64' - inputs: - buildType: 'current' + - template: templates/flex-downloadPipelineArtifact.yml + parameters: + stepName: 'Download Pipeline Artifact - Linux x64' artifactName: 'drop-onnxruntime-java-linux-x64-tensorrt' targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-linux-x64-tensorrt' @@ -839,31 +853,31 @@ stages: rename %%~ni.nupkg %%~ni.zip unzip %%~ni.zip -d %%~ni del /Q %%~ni.zip - + unzip win-dml-x86.zip -d win-x86 mkdir %%~ni\runtimes\win-x86 mkdir %%~ni\runtimes\win-x86\native - + move win-x86\runtimes\win-x86\native\onnxruntime.dll %%~ni\runtimes\win-x86\native\onnxruntime.dll move win-x86\runtimes\win-x86\native\onnxruntime.lib %%~ni\runtimes\win-x86\native\onnxruntime.lib move win-x86\runtimes\win-x86\native\onnxruntime.pdb %%~ni\runtimes\win-x86\native\onnxruntime.pdb - + unzip win-dml-arm64.zip -d win-arm64 mkdir %%~ni\runtimes\win-arm64 mkdir %%~ni\runtimes\win-arm64\native - + move win-arm64\runtimes\win-arm64\native\onnxruntime.dll %%~ni\runtimes\win-arm64\native\onnxruntime.dll move win-arm64\runtimes\win-arm64\native\onnxruntime.lib %%~ni\runtimes\win-arm64\native\onnxruntime.lib move win-arm64\runtimes\win-arm64\native\onnxruntime.pdb %%~ni\runtimes\win-arm64\native\onnxruntime.pdb - + unzip win-dml-arm.zip -d win-arm mkdir %%~ni\runtimes\win-arm mkdir %%~ni\runtimes\win-arm\native - + move win-arm\runtimes\win-arm\native\onnxruntime.dll %%~ni\runtimes\win-arm\native\onnxruntime.dll move win-arm\runtimes\win-arm\native\onnxruntime.lib %%~ni\runtimes\win-arm\native\onnxruntime.lib move win-arm\runtimes\win-arm\native\onnxruntime.pdb %%~ni\runtimes\win-arm\native\onnxruntime.pdb - + pushd %%~ni zip -r ..\%%~ni.zip . popd diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml index dc6f855328..89ca888b4e 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml @@ -20,17 +20,17 @@ stages: variables: - name: OnnxRuntimeBuildDirectory value: '$(Build.BinariesDirectory)' - steps: - - task: DownloadPipelineArtifact@0 - displayName: 'Download Signed NuGet' - inputs: + steps: + - template: ../../templates/flex-downloadPipelineArtifact.yml + parameters: + stepName: 'Download Signed NuGet' artifactName: drop-signed-nuget-${{ parameters.ArtifactSuffix }} targetPath: '$(Build.BinariesDirectory)/nuget-artifact' - - task: DownloadPipelineArtifact@0 - displayName: 'Download Linux CustomOp TestData' - inputs: + - template: ../../templates/flex-downloadPipelineArtifact.yml + parameters: + stepName: 'Download Linux CustomOp TestData' artifactName: 'onnxruntime-linux-x64' targetPath: '$(Build.BinariesDirectory)/testdata' diff --git a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml index 7c22b1dfbe..0405dd0ae5 100644 --- a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml @@ -918,5 +918,3 @@ stages: - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 displayName: 'Clean Agent Directories' condition: always() - - diff --git a/tools/ci_build/github/azure-pipelines/templates/flex-downloadPipelineArtifact.yml b/tools/ci_build/github/azure-pipelines/templates/flex-downloadPipelineArtifact.yml new file mode 100644 index 0000000000..060a5f1ba0 --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/templates/flex-downloadPipelineArtifact.yml @@ -0,0 +1,24 @@ +parameters: + - name: stepName + type: string + + - name: artifactName + type: string + + - name: targetPath + type: string + +steps: + - task: DownloadPipelineArtifact@2 + displayName: ${{ parameters.stepName }}} + inputs: + artifactName: ${{ parameters.artifactName}} + targetPath: '${{ parameters.targetPath }}' + ${{ if eq(variables.specificArtifact, false)}}: + buildType: 'current' + ${{ else }}: + source: 'specific' + project: $(System.TeamProject) + pipeline: $(Build.DefinitionName) + runVersion: 'specific' + runId: $(otherRunId)