microsoft/onnxruntime-extensions

Public

mirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
edgchen1/fix_android_nuget

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.pipelines/OneBranch.Official.yml

129lines · modecode

1#################################################################################
2# OneBranch Pipelines - Official #
3# This pipeline was created by EasyStart from a sample located at: #
4# https://aka.ms/obpipelines/easystart/samples #
5# Documentation: https://aka.ms/obpipelines #
6# Yaml Schema: https://aka.ms/obpipelines/yaml/schema #
7# Retail Tasks: https://aka.ms/obpipelines/tasks #
8# Support: https://aka.ms/onebranchsup #
9#################################################################################
10
11trigger: none
12
13parameters: # parameters are shown up in ADO UI in a build queue time
14- name: 'debug'
15 displayName: 'Enable debug output'
16 type: boolean
17 default: false
18
19variables:
20 CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)]
21 system.debug: ${{ parameters.debug }}
22 ENABLE_PRS_DELAYSIGN: 1
23 ROOT: $(Build.SourcesDirectory)
24 REPOROOT: $(Build.SourcesDirectory)
25 OUTPUTROOT: $(REPOROOT)\out
26 NUGET_XMLDOC_MODE: none
27 CIBW_BUILD: cp3{7,8,9,10}-*amd64
28 CIBW_ARCHS: AMD64
29 DEBIAN_FRONTEND: noninteractive
30
31resources:
32 repositories:
33 - repository: templates
34 type: git
35 name: OneBranch.Pipelines/GovernedTemplates
36 ref: refs/heads/main
37
38extends:
39 template: v2/OneBranch.Official.CrossPlat.yml@templates
40 parameters:
41 cloudvault:
42 enabled: false
43 globalSdl:
44 tsa:
45 enabled: true
46 binskim:
47 break: true # always break the build on binskim issues in addition to TSA upload
48 analyzeTargetGlob: '**\RelWithDebInfo\ortextensions.dll' # avoid scanning the 3rd party DLLs.
49 codeql:
50 python:
51 enabled: true
52 policheck:
53 break: true # always break the build on policheck issues. You can disable it by setting to 'false'
54 exclusionsFile: '$(REPOROOT)\.config\policheck_exclusions.xml'
55
56 stages:
57 - stage: Windows_Build
58 jobs:
59 - job: main
60 pool:
61 type: windows
62
63 variables:
64 ob_outputDirectory: '$(REPOROOT)\out'
65 ob_sdl_binskim_break: true
66 steps:
67 - script: |
68 @echo off
69 set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
70 for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do (
71 set vslatest="%%i"
72 if exist "%%i\Common7\Tools\vsdevcmd.bat" (
73 set vsdevcmd="%%i\Common7\Tools\vsdevcmd.bat"
74 )
75 if exist "%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" (
76 set vscmake="%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
77 )
78 if exist "%%i\MSBuild\Current\Bin\amd64\msbuild.exe" (
79 set vsmsbuild="%%i\MSBuild\Current\Bin\amd64\msbuild.exe"
80 )
81 )
82
83 @echo vslatest %vslatest%
84 @echo vsdevcmd %vsdevcmd%
85 @echo vscmake %vscmake%
86 @echo vsmsbuild %vsmsbuild%
87
88 @echo ##vso[task.setvariable variable=vslatest]%vslatest%
89 @echo ##vso[task.setvariable variable=vsdevcmd]%vsdevcmd%
90 @echo ##vso[task.setvariable variable=vscmake]%vscmake%
91 @echo ##vso[task.setvariable variable=vsmsbuild]%vsmsbuild%
92 displayName: 'locate vsdevcmd via vswhere'
93 - script: |
94 call $(vsdevcmd)
95 set PYTHONPATH=
96 set PYTHONHOME=
97 python -m pip install --upgrade pip
98 python -m pip install cibuildwheel numpy
99 python -m cibuildwheel --platform windows --archs AMD64 --output-dir $(REPOROOT)\out
100 displayName: Build wheels
101 - task: SDLNativeRules@3
102 inputs:
103 msBuildArchitecture: amd64
104 setupCommandlines: '"$(vscmake)" $(REPOROOT) -A x64 -B $(REPOROOT)\windows_out -DOCOS_BUILD_PYTHON=ON -DOCOS_ENABLE_CTEST=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo'
105 msBuildCommandline: '"$(vsmsbuild)" "$(REPOROOT)\windows_out\onnxruntime_extensions.sln" /p:RunCodeAnalysis=true /p:platform=x64 /p:configuration=RelWithDebInfo /p:VisualStudioVersion="16.0" /m /p:PreferredToolArchitecture=x64'
106 excludedPaths: '$(REPOROOT)\windows_out#$(Build.SourcesDirectory)\cmake#C:\program files (x86)'
107 displayName: 'Run the PREfast SDL Native Rules for MSBuild'
108 - task: PostAnalysis@2
109 inputs:
110 GdnBreakGdnToolSDLNativeRulesSeverity: Warning
111 GdnBreakGdnToolSDLNativeRules: true
112 displayName: 'Guardian Break'
113 - script: |
114 7z x $(REPOROOT)\out\*.whl -o$(REPOROOT)\out\*
115 displayName: unzip the package
116 - task: onebranch.pipeline.signing@1
117 inputs:
118 command: 'sign'
119 signing_profile: 'external_distribution'
120 files_to_sign: '**/**/*.pyd;**/**/*.dll'
121 search_root: '$(REPOROOT)\out'
122 displayName: 'Sign runtime DLLs'
123 - script: |
124 for /D %%i in ("out\onnxruntime_extensions*-win*") do (
125 7z u %%i.whl .\%%i\*
126 rmdir /s /q %%i
127 )
128 workingDirectory: '$(REPOROOT)'
129 displayName: zip package
130