From 160165016116c2e180399bd03a17d29cb999501f Mon Sep 17 00:00:00 2001 From: shahasad <43590019+shahasad@users.noreply.github.com> Date: Tue, 23 Jul 2019 11:07:35 -0700 Subject: [PATCH] publish nuget package to azure blob (#1309) --- .../azure-pipelines/nuget/templates/cpu.yml | 21 ++++++++++++++++++- .../set-version-number-variables-step.yml | 7 +++++++ 2 files changed, 27 insertions(+), 1 deletion(-) 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 335ec41957..6dde926468 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml @@ -91,7 +91,13 @@ jobs: cd $cwd - job: NuGet_Packaging - pool: $(AgentPoolWin) + 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 dependsOn: - Windows_CI_Dev - Windows_CI_Dev_x86 @@ -150,4 +156,17 @@ jobs: artifactName: 'drop-signed-nuget' targetPath: '$(Build.ArtifactStagingDirectory)' + - template: ../../templates/set-version-number-variables-step.yml + - task: AzureFileCopy@3 + displayName: 'Copy Signed NuGet Package to Blob Store' + condition: ${{ parameters.DoEsrp }} + inputs: + SourcePath: '$(Build.ArtifactStagingDirectory)/Microsoft.ML.OnnxRuntime.$(OnnxRuntimeVersion)-dev-$(OnnxRuntimeGitCommitHashShort).nupkg' + azureSubscription: 'AI Infra Build (00c06639-6ee4-454e-8058-8d8b1703bd87)' + Destination: AzureBlob + storage: ortpackages + ContainerName: ortpackages + - template: test_all_os.yml + + diff --git a/tools/ci_build/github/azure-pipelines/templates/set-version-number-variables-step.yml b/tools/ci_build/github/azure-pipelines/templates/set-version-number-variables-step.yml index 007d40b7ae..dcbdcffb73 100644 --- a/tools/ci_build/github/azure-pipelines/templates/set-version-number-variables-step.yml +++ b/tools/ci_build/github/azure-pipelines/templates/set-version-number-variables-step.yml @@ -12,6 +12,10 @@ steps: FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse HEAD`) DO ( @echo ##vso[task.setvariable variable=OnnxRuntimeGitCommitHash;]%%F ) + + FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO ( + @echo ##vso[task.setvariable variable=OnnxRuntimeGitCommitHashShort;]%%F + ) workingDirectory: '$(Build.SourcesDirectory)' condition: eq(variables['Agent.OS'], 'Windows_NT') @@ -26,5 +30,8 @@ steps: _OnnxRuntimeGitCommitHash=$(git rev-parse HEAD) echo "##vso[task.setvariable variable=OnnxRuntimeGitCommitHash;]$_OnnxRuntimeGitCommitHash" + _OnnxRuntimeGitCommitHash=$(git rev-parse --short=8 HEAD) + echo "##vso[task.setvariable variable=OnnxRuntimeGitCommitHashShort;]$_OnnxRuntimeGitCommitHash" + workingDirectory: '$(Build.SourcesDirectory)' condition: not(eq(variables['Agent.OS'], 'Windows_NT')) \ No newline at end of file