mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-26 19:52:38 +00:00
185 lines
7.4 KiB
YAML
185 lines
7.4 KiB
YAML
# Defined as pipeline variables
|
|
# variables:
|
|
# AgentPoolWin : 'Win-CPU'
|
|
# AgentPoolLinux : 'Linux-CPU'
|
|
# AgentPoolMacOS : 'macOS-10.13'
|
|
|
|
parameters:
|
|
DoEsrp: 'false'
|
|
DoCompliance: 'false'
|
|
|
|
jobs:
|
|
- template: ../../templates/win-ci.yml
|
|
parameters:
|
|
AgentPool : $(AgentPoolWin)
|
|
JobName: 'Windows_CI_Dev'
|
|
BuildCommand: '$(Build.SourcesDirectory)\tools\ci_build\build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --cmake_path $(Build.BinariesDirectory)\cmake\bin\cmake.exe --ctest_path $(Build.BinariesDirectory)\cmake\bin\ctest.exe --use_openmp --build_shared_lib --build_csharp --enable_onnx_tests'
|
|
DoDebugBuild: 'false'
|
|
DoNugetPack : 'true'
|
|
DoCompliance: ${{ parameters.DoCompliance }}
|
|
DoEsrp: ${{ parameters.DoEsrp }}
|
|
NuPackScript: |
|
|
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreatePackage
|
|
copy $(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
|
|
|
|
|
|
- template: ../../templates/win-x86-ci.yml
|
|
parameters:
|
|
AgentPool : $(AgentPoolWin)
|
|
JobName: 'Windows_CI_Dev_x86'
|
|
BuildCommand: '$(Build.SourcesDirectory)\tools\ci_build\build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --cmake_path $(Build.BinariesDirectory)\cmake\bin\cmake.exe --ctest_path $(Build.BinariesDirectory)\cmake\bin\ctest.exe --use_openmp --build_shared_lib --build_csharp --enable_onnx_tests --x86'
|
|
DoDebugBuild: 'false'
|
|
DoNugetPack : 'true'
|
|
DoCompliance: 'false'
|
|
DoEsrp: ${{ parameters.DoEsrp }}
|
|
NuPackScript: |
|
|
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=x86 /t:CreatePackage
|
|
cd $(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\
|
|
ren *.nupkg win-x86.zip
|
|
copy $(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\*zip $(Build.ArtifactStagingDirectory)
|
|
|
|
- template: ../../templates/linux-ci.yml
|
|
parameters:
|
|
AgentPool : $(AgentPoolLinux)
|
|
JobName: 'Linux_CI_Dev'
|
|
BuildCommand: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory)'
|
|
DoNugetPack : 'true'
|
|
ArtifactName: 'drop-linux'
|
|
NuPackScript: |
|
|
set -e -x
|
|
mkdir $(Build.BinariesDirectory)/linux-x64
|
|
cp $(Build.BinariesDirectory)/Release/libonnxruntime.so $(Build.BinariesDirectory)/linux-x64
|
|
cd $(Build.BinariesDirectory)
|
|
zip -r linux-x64.zip linux-x64
|
|
cp $(Build.BinariesDirectory)/linux*.zip $(Build.ArtifactStagingDirectory)
|
|
ls -al $(Build.ArtifactStagingDirectory)
|
|
|
|
- template: ../../templates/mac-ci.yml
|
|
parameters:
|
|
AgentPool : $(AgentPoolMacOS)
|
|
JobName: 'MacOS_CI_Dev'
|
|
BuildCommand: 'python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --use_openmp --enable_onnx_tests --config RelWithDebInfo'
|
|
DoNugetPack : 'true'
|
|
NuPackScript: |
|
|
set -e -x
|
|
mkdir $(Build.BinariesDirectory)/osx-x64
|
|
find $(Build.BinariesDirectory)
|
|
cp $(Build.BinariesDirectory)/RelWithDebInfo/libonnxruntime.dylib $(Build.BinariesDirectory)/osx-x64/
|
|
dsymutil $(Build.BinariesDirectory)/osx-x64/libonnxruntime.dylib -o $(Build.BinariesDirectory)/osx-x64/libonnxruntime.dylib.dSYM
|
|
strip -S -x $(Build.BinariesDirectory)/osx-x64/libonnxruntime.dylib
|
|
find $(Build.BinariesDirectory)/osx-x64 -ls
|
|
cwd=`pwd`
|
|
cd $(Build.BinariesDirectory)
|
|
zip -r osx-x64.zip osx-x64
|
|
cp $(Build.BinariesDirectory)/osx-x64.zip $(Build.ArtifactStagingDirectory)
|
|
cd $cwd
|
|
|
|
- job: NuGet_Packaging
|
|
pool: $(AgentPoolWin)
|
|
dependsOn:
|
|
- Windows_CI_Dev
|
|
- Windows_CI_Dev_x86
|
|
- Linux_CI_Dev
|
|
- MacOS_CI_Dev
|
|
condition: succeeded()
|
|
steps:
|
|
|
|
- task: DownloadPipelineArtifact@0
|
|
displayName: 'Download Pipeline Artifact - NuGet'
|
|
inputs:
|
|
artifactName: 'drop-nuget'
|
|
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
|
continueOnError: true
|
|
|
|
|
|
- task: DownloadPipelineArtifact@0
|
|
displayName: 'Download Pipeline Artifact - Win-x86'
|
|
inputs:
|
|
artifactName: 'drop-win-x86-zip'
|
|
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
|
continueOnError: true
|
|
|
|
- task: DownloadPipelineArtifact@0
|
|
displayName: 'Download Pipeline Artifact - Linux'
|
|
inputs:
|
|
artifactName: 'drop-linux'
|
|
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
|
continueOnError: true
|
|
|
|
- task: DownloadPipelineArtifact@0
|
|
displayName: 'Download Pipeline Artifact - MacOS'
|
|
inputs:
|
|
artifactName: 'drop-osx'
|
|
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
|
continueOnError: true
|
|
|
|
- template: bundle_dlls.yml
|
|
|
|
- template: ../../templates/esrp_nuget.yml
|
|
parameters:
|
|
DisplayName: 'ESRP - sign NuGet package'
|
|
FolderPath: '$(Build.ArtifactStagingDirectory)'
|
|
DoEsrp: ${{ parameters.DoEsrp }}
|
|
|
|
- task: PublishPipelineArtifact@0
|
|
displayName: 'Publish Pipeline NuGet Artifact'
|
|
inputs:
|
|
artifactName: 'drop-signed-nuget'
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
- template: test_all_os.yml
|
|
|
|
- job: Publish_NuGet_Package_And_Report
|
|
variables:
|
|
- group: Dashboard_MySQL_Secret
|
|
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
|
|
- NuGet_Test_MacOS
|
|
steps:
|
|
|
|
- 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)
|
|
|
|
- template: get-nuget-package-version-as-variable.yml
|
|
parameters:
|
|
packageFolder: '$(Build.BinariesDirectory)/nuget-artifact/final-package'
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Get Current Date'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
$date = $(Get-Date -Format "yyyy-MM-dd")
|
|
Write-Host "##vso[task.setvariable variable=CurrentDate]$date"
|
|
|
|
- task: AzureFileCopy@3
|
|
displayName: 'Copy Signed NuGet Package to Blob Store'
|
|
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
|
|
inputs:
|
|
sourcePath: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.$(NuGetPackageVersionNumber).nupkg'
|
|
azureSubscription: 'AIInfraBuildOnnxRuntimeOSS'
|
|
destination: azureBlob
|
|
storage: ortpackages
|
|
containerName: ortpackages
|
|
blobPrefix: '$(CurrentDate)/'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Copy Signed NuGet Package to Internal NuGet Feed'
|
|
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.$(NuGetPackageVersionNumber).nupkg'
|
|
feedPublish: 'OnnxRuntime'
|