microsoft/onnxruntime-extensions
Publicmirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable
.pipelines/templates/ios-framework-build.yml
66lines · modecode
| 1 | # packaging pipeline for onnxruntime-extensions ios cocoapods package |
| 2 | parameters: |
| 3 | - name: Platform |
| 4 | displayName: ios Platform |
| 5 | type: string |
| 6 | |
| 7 | - name: IosArch |
| 8 | displayName: IosArch |
| 9 | type: string |
| 10 | |
| 11 | - name: IsReleaseBuild |
| 12 | displayName: "Is this a release build?" |
| 13 | type: boolean |
| 14 | |
| 15 | |
| 16 | - name: AdditionalBuildFlags |
| 17 | displayName: Additional build flags for /tools/ios/build_xcframework.py |
| 18 | type: string |
| 19 | |
| 20 | jobs: |
| 21 | - job: IOS_C_API_Packaging_${{ parameters.Platform }}_${{ parameters.IosArch }} |
| 22 | condition: succeeded() |
| 23 | pool: |
| 24 | vmImage: "macOS-12" |
| 25 | timeoutInMinutes: 120 |
| 26 | variables: |
| 27 | buildConfig: Release |
| 28 | steps: |
| 29 | - task: UsePythonVersion@0 |
| 30 | inputs: |
| 31 | versionSpec: "3.9" |
| 32 | addToPath: true |
| 33 | architecture: "x64" |
| 34 | |
| 35 | # iOS xcframework build doesn't work with CMake 3.25.1, pin to 3.25.0 |
| 36 | - script: | |
| 37 | python -m pip install cmake==3.25.0 |
| 38 | displayName: "Install CMake 3.25.0" |
| 39 | |
| 40 | - template: set-package-version-variable-step.yml |
| 41 | parameters: |
| 42 | IsReleaseBuild: ${{ parameters.IsReleaseBuild }} |
| 43 | PackageVersionVariableName: ORT_EXTENSIONS_POD_VERSION |
| 44 | |
| 45 | - script: | |
| 46 | python ./tools/ios/build_xcframework.py \ |
| 47 | --output_dir $(Build.BinariesDirectory)/xcframework_out \ |
| 48 | --config $(buildConfig) \ |
| 49 | --platform_arch ${{ parameters.Platform }} ${{ parameters.IosArch }} \ |
| 50 | --mode build_platform_arch_frameworks_only \ |
| 51 | ${{parameters.AdditionalBuildFlags}} |
| 52 | displayName: "Build xcframework" |
| 53 | |
| 54 | - bash: | |
| 55 | set -e -x |
| 56 | |
| 57 | package_name=onnxruntime-extensions-ios-${{ parameters.Platform }}-${{ parameters.IosArch }}-lib.tgz |
| 58 | target_folder=xcframework_out/intermediates/${{ parameters.Platform }}/${{ parameters.IosArch }} |
| 59 | framework_info=${target_folder}/framework_info.json |
| 60 | tar -cvzf $(Build.ArtifactStagingDirectory)/${package_name} -C $(Build.BinariesDirectory)/ ${target_folder}/static_framework ${framework_info} |
| 61 | |
| 62 | displayName: "Assemble artifacts" |
| 63 | |
| 64 | - publish: "$(Build.ArtifactStagingDirectory)" |
| 65 | artifact: onnxruntime-extensions-ios-${{ parameters.Platform }}-${{ parameters.IosArch }}-lib |
| 66 | displayName: "Publish artifacts" |
| 67 | |