mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-07 17:15:29 +00:00
[Nodejs binding] create a new pipeline to generate signed binaries (#4104)
* add yml files * update pipeline * fix yaml syntax * yaml pop BuildCSharp * udpate yaml * do not stage codesign summary
This commit is contained in:
parent
3f7b97a63d
commit
647a886587
4 changed files with 96 additions and 26 deletions
|
|
@ -0,0 +1,14 @@
|
|||
# schedules:
|
||||
# - cron: "0 8 * * *"
|
||||
# displayName: Daily Build
|
||||
# branches:
|
||||
# include:
|
||||
# - master
|
||||
# always: true
|
||||
|
||||
jobs:
|
||||
- template: templates/cpu.yml
|
||||
parameters:
|
||||
AgentPool : 'Win-CPU-2019'
|
||||
DoEsrp: 'true'
|
||||
DoCompliance: 'true'
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
parameters:
|
||||
DoEsrp: 'false'
|
||||
DoCompliance: 'false'
|
||||
BuildCSharp: 'false'
|
||||
|
||||
jobs:
|
||||
- template: ../../templates/win-ci-2019.yml
|
||||
parameters:
|
||||
AgentPool : 'Win-CPU-2019'
|
||||
ArtifactName: 'drop-nodejs'
|
||||
JobName: 'Windows_CI_Dev'
|
||||
BuildCommand: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --use_openmp --build_nodejs --enable_onnx_tests --enable_wcos --cmake_generator "Visual Studio 16 2019"'
|
||||
BuildArch: 'x64'
|
||||
EnvSetupScript: 'setup_env.bat'
|
||||
sln_platform: 'x64'
|
||||
DoDebugBuild: 'false'
|
||||
DoNodejsPack : 'true'
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
DoCompliance: ${{ parameters.DoCompliance }}
|
||||
BuildCSharp: ${{ parameters.BuildCSharp }}
|
||||
|
|
@ -2,6 +2,7 @@ parameters:
|
|||
FolderPath: ''
|
||||
DisplayName: ''
|
||||
DoEsrp: 'false'
|
||||
Pattern: '*.dll'
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters['DoEsrp'], 'true') }}:
|
||||
|
|
@ -10,7 +11,7 @@ steps:
|
|||
inputs:
|
||||
ConnectedServiceName: 'OnnxRuntime CodeSign 20190817'
|
||||
FolderPath: ${{ parameters.FolderPath }}
|
||||
Pattern: '*.dll'
|
||||
Pattern: ${{ parameters.Pattern }}
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: |
|
||||
[
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ parameters:
|
|||
DoCompliance: 'false'
|
||||
BuildCommand: ''
|
||||
JobName: 'Windows_CI_Dev'
|
||||
BuildCSharp: 'true'
|
||||
DoNugetPack: 'false'
|
||||
NuPackScript : ''
|
||||
ArtifactName: 'drop-nuget'
|
||||
DoNodejsPack: 'false'
|
||||
DoEsrp: 'false'
|
||||
DoTestCoverage: 'false'
|
||||
BuildArch: 'x64' # Optional. Options: x86, x64
|
||||
|
|
@ -111,36 +113,40 @@ jobs:
|
|||
createLogFile: true
|
||||
|
||||
# The Configuration variable is required to build C#
|
||||
- script: |
|
||||
@echo ##vso[task.setvariable variable=Configuration]$(BuildConfig)
|
||||
displayName: 'Set Configuration variable'
|
||||
- ${{ if eq(parameters.BuildCSharp, true) }}:
|
||||
- script: |
|
||||
@echo ##vso[task.setvariable variable=Configuration]$(BuildConfig)
|
||||
displayName: 'Set Configuration variable'
|
||||
|
||||
- template: set-test-data-variables-step.yml
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: Use Nuget 4.9
|
||||
inputs:
|
||||
versionSpec: 4.9.4
|
||||
- ${{ if eq(parameters.BuildCSharp, true) }}:
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: Use Nuget 4.9
|
||||
inputs:
|
||||
versionSpec: 4.9.4
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Restore nuget packages'
|
||||
inputs:
|
||||
command: restore
|
||||
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
|
||||
configuration: '$(BuildConfig)'
|
||||
arguments: '--configuration $(BuildConfig) -p:Platform="Any CPU" -p:OrtPackageId=${{ parameters.OrtPackageId }}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
- ${{ if eq(parameters.BuildCSharp, true) }}:
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Restore nuget packages'
|
||||
inputs:
|
||||
command: restore
|
||||
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
|
||||
configuration: '$(BuildConfig)'
|
||||
arguments: '--configuration $(BuildConfig) -p:Platform="Any CPU" -p:OrtPackageId=${{ parameters.OrtPackageId }}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Build C#'
|
||||
inputs:
|
||||
command: build
|
||||
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
|
||||
configuration: '$(BuildConfig)'
|
||||
arguments: '--configuration $(BuildConfig) -p:Platform="Any CPU" -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=${{ parameters.OrtPackageId }}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
- ${{ if eq(parameters.BuildCSharp, true) }}:
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Build C#'
|
||||
inputs:
|
||||
command: build
|
||||
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
|
||||
configuration: '$(BuildConfig)'
|
||||
arguments: '--configuration $(BuildConfig) -p:Platform="Any CPU" -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=${{ parameters.OrtPackageId }}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- ${{ if in(parameters['sln_platform'], 'Win32', 'x64') }}:
|
||||
- ${{ if and(eq(parameters.BuildCSharp, true), in(parameters['sln_platform'], 'Win32', 'x64')) }}:
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Test C#'
|
||||
inputs:
|
||||
|
|
@ -173,7 +179,7 @@ jobs:
|
|||
condition: succeededOrFailed()
|
||||
|
||||
# Nuget packaging if needed
|
||||
- ${{ if eq(parameters['DoNugetPack'], 'true') }}:
|
||||
- ${{ if and(eq(parameters.BuildCSharp, true), eq(parameters['DoNugetPack'], 'true')) }}:
|
||||
- task: BatchScript@1
|
||||
displayName: 'Setup VS2019 env vars'
|
||||
inputs:
|
||||
|
|
@ -212,6 +218,35 @@ jobs:
|
|||
searchPattern: '**/*.pdb'
|
||||
symbolServerType: teamServices
|
||||
|
||||
# Node.js Publish
|
||||
- ${{ if eq(parameters['DoNodejsPack'], 'true') }}:
|
||||
- task: BatchScript@1
|
||||
displayName: 'Setup VS2019 env vars'
|
||||
inputs:
|
||||
filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'
|
||||
arguments: ${{ parameters.BuildArch }}
|
||||
modifyEnvironment: true
|
||||
- template: esrp_dll.yml
|
||||
parameters:
|
||||
FolderPath: '$(Build.SourcesDirectory)\nodejs\bin\napi-v3\win32\x64'
|
||||
DisplayName: 'ESRP - Sign Node.js binding binaries'
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
Pattern: '*.dll,*.node'
|
||||
|
||||
- script: |
|
||||
del /Q $(Build.SourcesDirectory)\nodejs\bin\napi-v3\win32\x64\CodeSignSummary-*.*
|
||||
call npm pack
|
||||
copy $(Build.SourcesDirectory)\nodejs\onnxruntime-*.tgz $(Build.ArtifactStagingDirectory)
|
||||
copy $(Build.SourcesDirectory)\nodejs\prebuilds $(Build.ArtifactStagingDirectory)
|
||||
workingDirectory: '$(Build.SourcesDirectory)\nodejs'
|
||||
displayName: 'Create NPM Package'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
|
||||
inputs:
|
||||
artifactName: ${{ parameters.ArtifactName }}
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
# Compliance tasks require logs from Debug Build
|
||||
- ${{ if eq(parameters['DoCompliance'], 'true') }}:
|
||||
- template: compliance.yml
|
||||
|
|
|
|||
Loading…
Reference in a new issue