From fb5d0fc538c59e5fc79fc1a999e8f304b8ea6a94 Mon Sep 17 00:00:00 2001 From: shahasad <43590019+shahasad@users.noreply.github.com> Date: Wed, 31 Jul 2019 14:17:54 -0700 Subject: [PATCH] Publish nuget package to azure blob store (#1525) Publish daily build NuGet package to Azure blob store for sharing among internal partners --- .../azure-pipelines/nuget/templates/cpu.yml | 16 +++++++++++++++- .../upload-binary-sizes-from-nuget-package.yml | 5 +++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml index dca49ee42d..24805a2264 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml @@ -158,10 +158,14 @@ jobs: - job: Publish_NuGet_Package_And_Report variables: - group: Dashboard_MySQL_Secret - condition: ${{ parameters.DoEsrp }} pool: name: Hosted Windows 2019 with VS2019 + # AzureFileCopy@3 task has some bug that it depends on a particular version of azure power shell, + # which is not available in OnnxRuntime build VMs, but available in the latest hosted agents. + # So, all the copy/publish jobs are being run on hosted agent + # TODO: install the desired azureps on our VMs or use later bugfixed version of AzureFileCopy demands: azureps + condition: and (${{ parameters.DoEsrp }}, eq(variables['Build.SourceBranch'], 'refs/heads/master')) dependsOn: - NuGet_Test_Win - NuGet_Test_Linux @@ -171,6 +175,16 @@ jobs: - template: ../../templates/set-version-number-variables-step.yml - template: upload-binary-sizes-from-nuget-package.yml parameters: + downloadPath: $(Build.BinariesDirectory)/nuget-artifact/final-package gitCommitHash: $(OnnxRuntimeGitCommitHashShort) + - task: AzureFileCopy@3 + displayName: 'Copy Signed NuGet Package to Blob Store' + condition: ne(variables['IsReleaseBuild'], 'true') # rlease build has a different package naming scheme + inputs: + sourcePath: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.$(OnnxRuntimeVersion)-dev-$(OnnxRuntimeGitCommitHashShort).nupkg' + azureSubscription: 'AIInfraBuildOnnxRuntimeOSS' + destination: azureBlob + storage: ortpackages + containerName: ortpackages diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/upload-binary-sizes-from-nuget-package.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/upload-binary-sizes-from-nuget-package.yml index 55e1813951..2b1e0aca9a 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/upload-binary-sizes-from-nuget-package.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/upload-binary-sizes-from-nuget-package.yml @@ -1,12 +1,13 @@ parameters: gitCommitHash: '' + downloadPath: $(Build.BinariesDirectory)/nuget-artifact/final-package steps: - task: DownloadPipelineArtifact@0 displayName: 'Download Pipeline Artifact - Signed NuGet Package' inputs: artifactName: 'drop-signed-nuget' - targetPath: '$(Build.BinariesDirectory)/nuget-artifact/final-package' + targetPath: '${{ parameters.downloadPath }}' - task: UsePythonVersion@0 inputs: @@ -26,7 +27,7 @@ steps: inputs: script: | echo changing directory to artifact download path - pushd $(Build.BinariesDirectory)\nuget-artifact\final-package + pushd "${{ parameters.downloadPath }}" echo processing nupkg FOR /R %%i IN (*.nupkg) do ( echo processing %%~ni.nupkg