Build OpenCV xcframework #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build OpenCV xcframework | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
build: | |
runs-on: macos-14 | |
steps: | |
- name: Prepare Xcode | |
run: | | |
sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer | |
- name: actions-setup-cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: 3.28 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: opencv-spm | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Get version | |
id: get_version | |
working-directory: opencv-spm | |
run: echo "VERSION=$(cat .version)" >> $GITHUB_OUTPUT | |
- name: Checkout OpenCV | |
uses: actions/checkout@v3 | |
with: | |
repository: opencv/opencv | |
ref: refs/tags/${{ steps.get_version.outputs.VERSION }} | |
path: 'opencv' | |
- name: Build xcframework | |
working-directory: opencv | |
env: | |
IPHONEOS_DEPLOYMENT_TARGET: 12.0 | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
run: | | |
git apply $GITHUB_WORKSPACE/opencv-spm/patches/*.patch | |
pip3 install pathlib | |
python3 platforms/apple/build_xcframework.py \ | |
--iphoneos_archs=arm64 \ | |
--visionos_archs=arm64 \ | |
--visionsimulator_archs=arm64 \ | |
--disable-bitcode -o build | |
- name: Zip artifact | |
working-directory: opencv | |
run: zip -ry opencv2.xcframework.zip build/opencv2.xcframework | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: opencv2.xcframework.zip | |
path: opencv/opencv2.xcframework.zip | |
if-no-files-found: error |