diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/get-nuget-package-version-as-variable.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/get-nuget-package-version-as-variable.yml index c5faef7108..d294e21818 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/get-nuget-package-version-as-variable.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/get-nuget-package-version-as-variable.yml @@ -15,6 +15,19 @@ steps: @echo ortversion is !ortversion! @echo ##vso[task.setvariable variable=NuGetPackageVersionNumber;]!ortversion! ) +- task: CmdLine@2 + condition: eq(variables['Agent.OS'], 'Windows_NT') + displayName: 'Extract version number from the DirectML NuPkg file, Windows VMs' + inputs: + workingDirectory: '${{ parameters.packageFolder }}' + script: | + SETLOCAL EnableDelayedExpansion + FOR /R %%i IN (Microsoft.ML.OnnxRuntime.DirectML*.nupkg) do ( + set filename=%%~ni + set ortversion=!filename:~33! + @echo DirectMLNuGetPackageVersionNumber is !ortversion! + @echo ##vso[task.setvariable variable=DirectMLNuGetPackageVersionNumber;]!ortversion! + ) - task: CmdLine@2 condition: not(eq(variables['Agent.OS'], 'Windows_NT')) displayName: 'Extract version number from the NuPkg file, Unix VMs' diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml index 36b506fbc0..233d40c16a 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml @@ -280,7 +280,7 @@ jobs: condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme inputs: command: 'push' - searchPatternPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.DirectML.$(NuGetPackageVersionNumber).nupkg' + searchPatternPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.DirectML.$(DirectMLNuGetPackageVersionNumber).nupkg' feedPublish: 'OnnxRuntime' - task: NuGetCommand@2 @@ -304,5 +304,5 @@ jobs: condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme inputs: command: 'push' - packagesToPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.DirectML.$(NuGetPackageVersionNumber).nupkg' + packagesToPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.DirectML.$(DirectMLNuGetPackageVersionNumber).nupkg' publishVstsFeed: '2692857e-05ef-43b4-ba9c-ccf1c22c437c/7982ae20-ed19-4a35-a362-a96ac99897b7' \ No newline at end of file