-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
102 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
tools/ci_build/github/azure-pipelines/stages/nuget_dml_packaging_stage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
parameters: | ||
- name: DoEsrp | ||
type: boolean | ||
default: true | ||
|
||
stages: | ||
- stage: NuGet_Packaging_DML | ||
dependsOn: | ||
- Windows_CI_GPU_DML_Dev | ||
- Windows_CI_GPU_DML_Dev_x86 | ||
- Windows_CI_GPU_DML_Dev_arm64 | ||
condition: succeeded() | ||
jobs: | ||
- job: NuGet_Packaging_DML | ||
workspace: | ||
clean: all | ||
pool: 'onnxruntime-Win2022-GPU-dml-A10' | ||
steps: | ||
- task: DownloadPipelineArtifact@0 | ||
displayName: 'Download Pipeline Artifact - NuGet DirectML' | ||
inputs: | ||
artifactName: 'drop-nuget-dml' | ||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml' | ||
|
||
- task: DownloadPipelineArtifact@0 | ||
displayName: 'Download Pipeline Artifact - NuGet DirectML x86' | ||
inputs: | ||
artifactName: 'drop-win-dml-x86-zip' | ||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml' | ||
|
||
- task: DownloadPipelineArtifact@0 | ||
displayName: 'Download Pipeline Artifact - NuGet DirectML arm64' | ||
inputs: | ||
artifactName: 'drop-win-dml-arm64-zip' | ||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml' | ||
|
||
- script: | | ||
pushd $(Build.BinariesDirectory)\nuget-artifact-dml | ||
dir | ||
powershell -Command "Invoke-WebRequest http://stahlworks.com/dev/unzip.exe -OutFile unzip.exe" | ||
powershell -Command "Invoke-WebRequest http://stahlworks.com/dev/zip.exe -OutFile zip.exe" | ||
set PATH=%CD%;%PATH% | ||
SETLOCAL EnableDelayedExpansion | ||
FOR /R %%i IN (*.nupkg) do ( | ||
set filename=%%~ni | ||
IF NOT "!filename:~25,7!"=="Managed" ( | ||
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 | ||
pushd %%~ni | ||
zip -r ..\%%~ni.zip . | ||
popd | ||
move %%~ni.zip %%~ni.nupkg | ||
) | ||
) | ||
popd | ||
copy $(Build.BinariesDirectory)\nuget-artifact-dml\Microsoft.ML.OnnxRuntime.DirectML*nupkg $(Build.ArtifactStagingDirectory) | ||
displayName: 'Bundle DML NuGet and other binaries' | ||
- template: ../templates/esrp_nuget.yml | ||
parameters: | ||
DisplayName: 'ESRP - sign NuGet package' | ||
FolderPath: '$(Build.ArtifactStagingDirectory)' | ||
DoEsrp: ${{ parameters.DoEsrp }} | ||
|
||
- template: ../templates/validate-package.yml | ||
parameters: | ||
PackageType: 'nuget' | ||
PackagePath: '$(Build.ArtifactStagingDirectory)' | ||
PackageName: 'Microsoft.ML.OnnxRuntime.DirectML*nupkg' | ||
PlatformsSupported: 'win-x64,win-x86,win-arm64' | ||
VerifyNugetSigning: ${{ parameters.DoEsrp }} | ||
|
||
- task: 1ES.PublishPipelineArtifact@1 | ||
displayName: 'Publish Pipeline NuGet Artifact' | ||
inputs: | ||
artifactName: 'drop-signed-nuget-dml' | ||
targetPath: '$(Build.ArtifactStagingDirectory)' | ||
- template: ../templates/component-governance-component-detection-steps.yml | ||
parameters: | ||
condition: 'succeeded' |