From bfa5eb4591fed374c07a8e9e8eda2ec4c682b3e2 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 11 Dec 2023 21:07:05 +0000 Subject: [PATCH] Adding a new pipeline for pubilshing cuda 12 nuget packages (#18713) ### Description ### Motivation and Context --- .../nuget-cuda-publishing-pipeline.yml | 24 ++++++++ .../stages/nuget-cuda-publishing-stage.yml | 59 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 tools/ci_build/github/azure-pipelines/nuget-cuda-publishing-pipeline.yml create mode 100644 tools/ci_build/github/azure-pipelines/stages/nuget-cuda-publishing-stage.yml diff --git a/tools/ci_build/github/azure-pipelines/nuget-cuda-publishing-pipeline.yml b/tools/ci_build/github/azure-pipelines/nuget-cuda-publishing-pipeline.yml new file mode 100644 index 0000000000000..0332be4883e2d --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/nuget-cuda-publishing-pipeline.yml @@ -0,0 +1,24 @@ +parameters: + - name: nightly + type: string + default: '1' + - name: build_id + type: string + default: 'latest' + - name: project + type: string + default: 'Lotus' + - name: pipeline + type: string + default: 'Nuget-CUDA-Packaging-Pipeline' + +stages: +- template: stages/nuget-cuda-publishing-stage.yml + parameters: + build_id: ${{ parameters.build_id }} + project: ${{ parameters.project }} + pipeline: ${{ parameters.pipeline }} + ${{ if ne(parameters.nightly, '1') }}: + artifact_feed: onnxruntime-cuda-12 + ${{ else }}: + artifact_feed: ort-cuda-12-nightly \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipelines/stages/nuget-cuda-publishing-stage.yml b/tools/ci_build/github/azure-pipelines/stages/nuget-cuda-publishing-stage.yml new file mode 100644 index 0000000000000..3699d5b24ae12 --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/stages/nuget-cuda-publishing-stage.yml @@ -0,0 +1,59 @@ +parameters: + - name: build_id + type: string + - name: project + type: string + - name: pipeline + type: string + - name: artifact_feed + type: string + default: 'onnxruntime-cuda-12' + - name: dependencies + type: string + default: 'none' + +stages: + - stage: NuGet_Publishing_GPU + ${{ if ne(parameters.dependencies, 'none') }}: + dependsOn: + ${{ if eq(parameters.dependencies, 'none') }}: + dependsOn: [] + jobs: + - job: + pool: 'onnxruntime-Win-CPU-2022' + steps: + - checkout: none + - script: | + echo "Project: ${{ parameters.project }}" + echo "Build ID: ${{ parameters.build_id }}" + echo "Pipeline: ${{ parameters.pipeline }}" + echo "Artifact Feed: ${{ parameters.artifact_feed }}" + displayName: 'Print Parameters' + - task: DownloadPipelineArtifact@2 + displayName: 'Download NuGet artifact drop-signed-nuget-GPU' + inputs: + artifact: drop-signed-nuget-GPU + targetPath: $(Build.BinariesDirectory)/nuget-artifact/final-package + ${{ if ne(parameters.build_id, 'latest') }}: + buildType: 'specific' + project: '${{ parameters.project }}' + pipeline: '${{ parameters.pipeline }}' + buildVersionToDownload: 'specific' + buildId: '${{ parameters.build_id }}' + - script: | + ls $(Build.BinariesDirectory)/nuget-artifact/final-package + displayName: List Downloaded Package + - template: ../nuget/templates/get-nuget-package-version-as-variable.yml + parameters: + packageFolder: '$(Build.BinariesDirectory)/nuget-artifact/final-package' + #This task must be run on a Windows machine + - task: NuGetCommand@2 + displayName: 'NuGet push ${{ parameters.artifact_feed }}' + inputs: + command: push + packagesToPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/*.nupkg' + publishVstsFeed: '2692857e-05ef-43b4-ba9c-ccf1c22c437c/d3daa2b0-aa56-45ac-8145-2c3dc0661c87' + allowPackageConflicts: true + + +