Skip to content

Commit

Permalink
xcframework step
Browse files Browse the repository at this point in the history
  • Loading branch information
skyline75489 committed Sep 14, 2024
1 parent 700de97 commit 84a0541
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .pipelines/stages/jobs/steps/capi-appleframework-step.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
parameters:
- name: build_config
type: string
default: 'release'

steps:

- checkout: self
clean: true
path: onnxruntime-genai
submodules: recursive

- template: utils/set-nightly-build-option-variable.yml

- powershell: |
New-Item -ItemType Directory -Path $(Build.Repository.LocalPath)\ort\lib -Force
$tmp = New-TemporaryFile
Invoke-WebRequest -Uri 'https://download.onnxruntime.ai/pod-archive-onnxruntime-c-1.19.2.zip'
$tmp | Expand-Archive -DestinationPath $(Build.Repository.LocalPath)\ort\lib
displayName: 'Download ORT xcframework'
workingDirectory: '$(Build.Repository.LocalPath)'

- script: |
python3 tools/ci_build/github/apple/build_apple_framework.py \
--build_dir "$(Build.BinariesDirectory)/apple_framework" \
tools/ci_build/github/apple/default_full_ios_framework_build_settings.json
mkdir $(Build.BinariesDirectory)/artifacts
mkdir -p $(Build.BinariesDirectory)/artifacts_staging/onnxruntime-genai-xcframework-$(genai_version)
cp -R $(Build.BinariesDirectory)/apple_framework/framework_out/onnxruntime-genai.xcframework \
$(Build.BinariesDirectory)/artifacts_staging/onnxruntime-genai-xcframework-$(genai_version)
pushd $(Build.BinariesDirectory)/artifacts_staging
zip -vr $(Build.BinariesDirectory)/artifacts/onnxruntime_xcframework.zip \
onnxruntime-genai-xcframework-$(genai_version)
popd
displayName: 'Build Apple XCFramework'
workingDirectory: '$(Build.Repository.LocalPath)'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime XCFramework'
inputs:
ArtifactName: capi-onnxruntime-genai-xcframework
PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts'

0 comments on commit 84a0541

Please sign in to comment.