microsoft/onnxruntime-extensions

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
b7b8816dab43f095079c5c7609764c702e3c6e49

Branches

Tags

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

Clone

HTTPS

Download ZIP

.pipelines/OneBranch.PullRequest.yml

131lines · 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 CIBW_BUILD_VERBOSITY: 1
30 DEBIAN_FRONTEND: noninteractive
31
32resources:
33 repositories:
34 - repository: templates
35 type: git
36 name: OneBranch.Pipelines/GovernedTemplates
37 ref: refs/heads/main
38
39extends:
40 template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates
41 parameters:
42 cloudvault:
43 enabled: false
44 globalSdl:
45 tsa:
46 enabled: false
47 binskim:
48 break: true # always break the build on binskim issues in addition to TSA upload
49 analyzeTargetGlob: '**\RelWithDebInfo\ortextensions.dll' # avoid scanning the 3rd party DLLs.
50 codeql:
51 compiled:
52 enabled: true
53 cadence: 10
54 policheck:
55 break: true # always break the build on policheck issues. You can disable it by setting to 'false'
56 exclusionsFile: '$(REPOROOT)\.config\policheck_exclusions.xml'
57
58 stages:
59 - stage: Windows_Build
60 jobs:
61 - job: main
62 pool:
63 type: windows
64
65 variables:
66 ob_outputDirectory: '$(REPOROOT)\out'
67 ob_sdl_binskim_break: true
68 steps:
69 - script: |
70 @echo off
71 set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
72 for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do (
73 set vslatest="%%i"
74 if exist "%%i\Common7\Tools\vsdevcmd.bat" (
75 set vsdevcmd="%%i\Common7\Tools\vsdevcmd.bat"
76 )
77 if exist "%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" (
78 set vscmake="%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
79 )
80 if exist "%%i\MSBuild\Current\Bin\amd64\msbuild.exe" (
81 set vsmsbuild="%%i\MSBuild\Current\Bin\amd64\msbuild.exe"
82 )
83 )
84
85 @echo vslatest %vslatest%
86 @echo vsdevcmd %vsdevcmd%
87 @echo vscmake %vscmake%
88 @echo vsmsbuild %vsmsbuild%
89
90 @echo ##vso[task.setvariable variable=vslatest]%vslatest%
91 @echo ##vso[task.setvariable variable=vsdevcmd]%vsdevcmd%
92 @echo ##vso[task.setvariable variable=vscmake]%vscmake%
93 @echo ##vso[task.setvariable variable=vsmsbuild]%vsmsbuild%
94 displayName: 'locate vsdevcmd via vswhere'
95 - script: |
96 call $(vsdevcmd)
97 set PYTHONPATH=
98 set PYTHONHOME=
99 python -m pip install --upgrade pip
100 python -m pip install cibuildwheel numpy
101 python -m cibuildwheel --platform windows --archs AMD64 --output-dir $(REPOROOT)\out
102 displayName: Build wheels
103 - task: SDLNativeRules@3
104 inputs:
105 msBuildArchitecture: amd64
106 setupCommandlines: '"$(vscmake)" $(REPOROOT) -A x64 -B $(REPOROOT)\windows_out -DOCOS_BUILD_PYTHON=ON -DOCOS_ENABLE_CTEST=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo'
107 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'
108 excludedPaths: '$(REPOROOT)\windows_out#$(Build.SourcesDirectory)\cmake#C:\program files (x86)'
109 displayName: 'Run the PREfast SDL Native Rules for MSBuild'
110 - task: PostAnalysis@2
111 inputs:
112 GdnBreakGdnToolSDLNativeRulesSeverity: Warning
113 GdnBreakGdnToolSDLNativeRules: true
114 displayName: 'Guardian Break'
115 - script: |
116 7z x $(REPOROOT)\out\*.whl -o$(REPOROOT)\out\*
117 displayName: unzip the package
118 - task: onebranch.pipeline.signing@1
119 inputs:
120 command: 'sign'
121 signing_profile: 'external_distribution'
122 files_to_sign: '**/**/*.pyd;**/**/*.dll'
123 search_root: '$(REPOROOT)\out'
124 displayName: 'Sign runtime DLLs'
125 - script: |
126 for /D %%i in ("out\onnxruntime_extensions*-win*") do (
127 7z u %%i.whl .\%%i\*
128 rmdir /s /q %%i
129 )
130 workingDirectory: '$(REPOROOT)'
131 displayName: zip package
132