microsoft/onnxruntime-extensions

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
d853d31fc12dbce2bee45430a7b1651d2da5a1f6

Branches

Tags

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

Clone

HTTPS

Download ZIP

.pipelines/ios_packaging.yml

141lines · modecode

1# packaging pipeline for iOS CocoaPods package
2
3parameters:
4- name: IsReleaseBuild
5 displayName: "Is this a release build?"
6 type: boolean
7 default: false
8
9jobs:
10- job: IosPackaging
11 displayName: "iOS Packaging"
12
13 pool:
14 vmImage: "macOS-13"
15
16 timeoutInMinutes: 120
17
18 steps:
19 - template: templates/use-xcode-version.yml
20
21 - task: UsePythonVersion@0
22 inputs:
23 disableDownloadFromRegistry: true
24 versionSpec: "3.9"
25 addToPath: true
26 architecture: "x64"
27
28 # iOS xcframework build doesn't work with CMake 3.25.1, pin to 3.25.0
29 - script: |
30 python -m pip install cmake==3.25.0
31 displayName: "Install CMake 3.25.0"
32
33 - template: templates/install-appcenter.yml
34
35 - template: templates/set-package-version-variable-step.yml
36 parameters:
37 IsReleaseBuild: ${{ parameters.IsReleaseBuild }}
38 PackageVersionVariableName: ORT_EXTENSIONS_POD_VERSION
39
40 - script: |
41 python ./tools/gen_selectedops.py ./tools/ios/package_ops.config
42 displayName: "Generate selected ops CMake file"
43
44 - script: |
45 python ./tools/ios/build_xcframework.py \
46 --output_dir $(Build.BinariesDirectory)/xcframework_out \
47 --config Release \
48 --cmake_extra_defines OCOS_ENABLE_SELECTED_OPLIST=ON
49 displayName: "Build xcframework"
50
51 - script: |
52 python ./tools/ios/assemble_pod_package.py \
53 --staging-dir $(Build.BinariesDirectory)/pod_staging \
54 --xcframework-output-dir $(Build.BinariesDirectory)/xcframework_out \
55 --pod-version ${ORT_EXTENSIONS_POD_VERSION}
56 displayName: "Assemble pod"
57
58 - script: |
59 pod lib lint
60 displayName: "Lint pod"
61 workingDirectory: $(Build.BinariesDirectory)/pod_staging
62
63 - script: |
64 ORT_EXTENSIONS_LOCAL_POD_PATH=$(Build.BinariesDirectory)/pod_staging \
65 pod install
66 displayName: "Install pods for OrtExtensionsUsage"
67 workingDirectory: $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage
68
69 - template: templates/run-with-ios-simulator-steps.yml
70 parameters:
71 steps:
72 - script: |
73 xcrun xcodebuild \
74 -sdk iphonesimulator \
75 -configuration Debug \
76 -workspace $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/OrtExtensionsUsage.xcworkspace \
77 -scheme OrtExtensionsUsage \
78 -destination "platform=iOS Simulator,id=${ORT_EXTENSIONS_BUILD_SIMULATOR_ID}" \
79 test CODE_SIGNING_ALLOWED=NO
80 displayName: Build and test OrtExtensionsUsage
81
82 - task: InstallAppleCertificate@2
83 inputs:
84 certSecureFile: '$(ios_signing_certificate_name)'
85 certPwd: '$(ios_signing_certificate_password)'
86 keychain: 'temp'
87 name: installSigningCertificate
88 displayName: "Install ORT Mobile Test Signing Certificate"
89
90 - task: InstallAppleProvisioningProfile@1
91 inputs:
92 provProfileSecureFile: '$(ios_provision_profile_name)'
93 removeProfile: true
94 name: installProvisioningProfile
95 displayName: "Install ORT Mobile Test Provisioning Profile"
96
97 - script: |
98 xcrun xcodebuild \
99 -sdk iphoneos \
100 -configuration Debug \
101 -workspace $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/OrtExtensionsUsage.xcworkspace \
102 -scheme OrtExtensionsUsage \
103 -derivedDataPath $(Build.BinariesDirectory)/appcenter_test_derived_data \
104 build-for-testing \
105 CODE_SIGN_STYLE=Manual \
106 "CODE_SIGN_IDENTITY=$(installSigningCertificate.signingIdentity)" \
107 PROVISIONING_PROFILE= \
108 "PROVISIONING_PROFILE_SPECIFIER=$(installProvisioningProfile.provisioningProfileName)"
109 displayName: "Build appcenter test"
110
111 - script: |
112 appcenter test run xcuitest \
113 --app "AI-Frameworks/ORT-Ext-Mobile-iOS-Testapp" \
114 --devices "AI-Frameworks/apple-test-device-set" \
115 --test-series "master" \
116 --locale "en_US" \
117 --build-dir $(Build.BinariesDirectory)/appcenter_test_derived_data/Build/Products/Debug-iphoneos \
118 --token $(app_center_api_token)
119 displayName: "Run appcenter test"
120
121 - script: |
122 set -e -x
123
124 POD_STAGING_DIR="$(Build.BinariesDirectory)/pod_staging"
125 ARTIFACTS_STAGING_DIR="$(Build.ArtifactStagingDirectory)"
126 POD_NAME="onnxruntime-extensions-c"
127 POD_ARCHIVE_BASENAME="pod-archive-${POD_NAME}-${ORT_EXTENSIONS_POD_VERSION}.zip"
128 PODSPEC_BASENAME="${POD_NAME}.podspec"
129
130 pushd ${POD_STAGING_DIR}
131
132 # assemble the files in the artifacts staging directory
133 zip -r ${ARTIFACTS_STAGING_DIR}/${POD_ARCHIVE_BASENAME} * --exclude ${PODSPEC_BASENAME}
134 cp ${PODSPEC_BASENAME} ${ARTIFACTS_STAGING_DIR}/${PODSPEC_BASENAME}
135
136 popd
137 displayName: "Assemble artifacts"
138
139 - publish: "$(Build.ArtifactStagingDirectory)"
140 artifact: ios_packaging_artifacts
141 displayName: "Publish artifacts"
142