-
Notifications
You must be signed in to change notification settings - Fork 24
65 lines (54 loc) · 1.72 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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