onnxruntime/tools/ci_build/github/azure-pipelines/nuget/templates/bundle_dlls.yml
Hariharan Seshadri 86b755774f
Create a separate Nuget hosting just managed assemblies (#3020)
* Initial commit

* More changes

* More changes

* More changes 3

* More changes 4

* More changes 5

* More changes 5

* More changes 6

* More changes 7

* More changes 8

* Remove C# ifdefs

* More changes 10

* More changes 11

* YAML changes for other release pipelines

* Add release notes metadata

* Props and Targets change

* Add CSHarp proj

* More changes 12

* More changes

* Minor fix

* Minor fix

* Fix yaml

* Some missing logic for winml

* Minor update

* Fix casing for winmd file

* Fix casing

* Add targets and props for managed section into native nuget

* revert file

* a
2020-02-27 18:00:17 -08:00

44 lines
2.3 KiB
YAML

# Bundle dlls, so and dylib into respective runtime folders
steps:
- script: |
pushd $(Build.BinariesDirectory)\nuget-artifact
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-x86.zip -d win-x86
unzip linux-x64.zip -d linux-x64
mkdir %%~ni\runtimes\win-x86
mkdir %%~ni\runtimes\linux-x64
mkdir %%~ni\runtimes\win-x86\native
mkdir %%~ni\runtimes\linux-x64\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
move win-x86\runtimes\win-x86\native\windows.ai.machinelearning.dll %%~ni\runtimes\win-x86\native\Windows.AI.MachineLearning.dll
move win-x86\runtimes\win-x86\native\windows.ai.machinelearning.lib %%~ni\runtimes\win-x86\native\Windows.AI.MachineLearning.lib
move win-x86\runtimes\win-x86\native\windows.ai.machinelearning.pdb %%~ni\runtimes\win-x86\native\Windows.AI.MachineLearning.pdb
move linux-x64\linux-x64\libonnxruntime.so %%~ni\runtimes\linux-x64\native\libonnxruntime.so
unzip osx-x64.zip -d osx-x64
dir osx-x64 /s
mkdir %%~ni\runtimes\osx-x64
mkdir %%~ni\runtimes\osx-x64\native
move osx-x64\osx-x64\libonnxruntime.dylib %%~ni\runtimes\osx-x64\native\libonnxruntime.dylib
move osx-x64\osx-x64\libonnxruntime.dylib.dSYM %%~ni\runtimes\osx-x64\native\libonnxruntime.dylib.dSYM
pushd %%~ni
zip -r ..\%%~ni.zip .
popd
move %%~ni.zip %%~ni.nupkg
)
)
popd
copy $(Build.BinariesDirectory)\nuget-artifact\*.nupkg $(Build.ArtifactStagingDirectory)
displayName: 'Bundle Native NuGet and other binaries'