Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Apr 29, 2024
1 parent 75d0179 commit a411b14
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
13 changes: 12 additions & 1 deletion .pipelines/stages/jobs/steps/capi-linux-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ steps:
--target onnxruntime-genai"
displayName: 'Build GenAi'
workingDirectory: '$(Build.Repository.LocalPath)'
- task: BinSkim@4
displayName: 'Run BinSkim'
inputs:
Expand All @@ -66,12 +67,22 @@ steps:
- template: utils/capi-archive.yml
parameters:
archiveType: tar
- script: |
set -e -x
docker run \
--rm \
--volume $(Build.Repository.LocalPath):/ort_genai_src \
-w /ort_genai_src/ onnxruntime$(ep)build$(arch) \
bash -c " \
/usr/bin/cmake --build --preset linux_$(arch)_$(ep)_release --target package"
displayName: 'Package C/C++ API'
workingDirectory: '$(Build.Repository.LocalPath)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime Genai capi'
inputs:
ArtifactName: $(artifactName)-capi
PathtoPublish: '$(Build.ArtifactStagingDirectory)/capi'
PathtoPublish: '$(Build.Repository.LocalPath)/build/$(ep)/package'

- ${{ if eq(parameters.target, 'python') }}:
- bash: |
Expand Down
9 changes: 5 additions & 4 deletions .pipelines/stages/jobs/steps/capi-win-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ steps:
AnalyzeTargetGlob: '$(Build.Repository.LocalPath)\**\*genai.dll'
continueOnError: true

- template: utils/capi-archive.yml
parameters:
archiveType: zip
- powershell: |
cmake --build --preset windows_$(arch)_$(ep)_release --target package
displayName: 'Package C/C++ API'
workingDirectory: '$(Build.Repository.LocalPath)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime Genai capi'
inputs:
ArtifactName: $(artifactName)-capi
PathtoPublish: '$(Build.ArtifactStagingDirectory)/capi'
PathtoPublish: '$(Build.Repository.LocalPath)\build\$(ep)\package'

- ${{ if eq(parameters.target, 'python') }}:
- task: BinSkim@4
Expand Down
4 changes: 1 addition & 3 deletions cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ set_target_properties(
)
install(TARGETS
onnxruntime-genai
onnxruntime-genai-static
ARCHIVE
LIBRARY
PUBLIC_HEADER
)
Expand All @@ -14,7 +12,7 @@ set(CPACK_PACKAGE_NAME "onnxruntime-genai")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/microsoft/onnxruntime-genai")
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/packages")
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/package")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${VERSION_INFO}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
if (WIN32)
set(CPACK_GENERATOR "ZIP")
Expand Down

0 comments on commit a411b14

Please sign in to comment.