forked from sccn/liblsl
-
Notifications
You must be signed in to change notification settings - Fork 0
202 lines (178 loc) · 6.61 KB
/
apple.yml
File metadata and controls
202 lines (178 loc) · 6.61 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Apple CI
on:
push:
branches:
- main
- dev
tags: ['*']
paths:
- '**'
- '!docs/**'
- '!.github/**'
- '.github/workflows/apple.yml'
pull_request:
release:
types: ['created']
workflow_dispatch:
inputs:
cmakeextra:
description: 'Extra CMake options'
required: false
default: ''
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {name: "macOS-latest", os: "macOS-latest", platform: "macos", cmake_extra: "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DLSL_UNITTESTS=ON -DLSL_BENCHMARKS=ON -DCMAKE_OSX_ARCHITECTURES=\"x86_64;arm64\"" }
- {name: "iOS", os: "macOS-latest", platform: "ios", cmake_extra: "-DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -DPLATFORM=OS64" }
- {name: "iOS Simulator", os: "macOS-latest", platform: "ios-simulator", cmake_extra: "-DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -DPLATFORM=SIMULATOR64COMBINED -G Xcode" }
steps:
- uses: actions/checkout@v4
- name: Install certificates and provisioning profiles
uses: ./.github/actions/install-apple-certs
with:
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
- name: Configure CMake
env:
APPLE_DEVELOPMENT_TEAM: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
run: |
cmake --version
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
-DLSL_FRAMEWORK=ON \
-Dlslgitrevision=${{ github.sha }} \
-Dlslgitbranch=${{ github.ref }} \
${{ matrix.config.cmake_extra }} \
${{ github.event.inputs.cmakeextra }}
echo ${PWD}
- name: make
run: cmake --build build --config Release -j
- name: make install
run: cmake --build build --config Release --target install
- name: test install using examples
if: matrix.config.name == 'macOS-latest'
run: |
# Test that the in-tree install was successful by building the examples
cmake -S examples -B examples/build \
-DLSL_INSTALL_ROOT=${PWD}/install \
-DCMAKE_INSTALL_PREFIX=examples/build/install \
-DLSL_COMFY_DEFAULTS=ON \
${{ matrix.config.cmake_extra }} \
${{ github.event.inputs.cmakeextra }}
cmake --build examples/build --target install --config Release -j
./examples/build/install/bin/HandleMetaData
- name: Codesign Framework
run: |
./scripts/apple_codesign.sh install/Frameworks/lsl.framework \
--platform ${{ matrix.config.platform }}
# run internal tests
- name: unit tests
if: matrix.config.name == 'macOS-latest'
run: |
mkdir -p dumps
install/bin/lsl_test_internal --order rand --wait-for-keypress never --durations yes
install/bin/lsl_test_exported --order rand --wait-for-keypress never --durations yes
timeout-minutes: 10
- name: Package and Notarize macOS Installer
if: matrix.config.name == 'macOS-latest'
env:
APPLE_DEVELOPMENT_TEAM: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
APPLE_NOTARIZE_USERNAME: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
APPLE_NOTARIZE_PASSWORD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
run: |
./scripts/apple_package_notarize.sh install/Frameworks/lsl.framework \
--notarize \
--output package
- name: upload dump
if: failure()
uses: actions/upload-artifact@v4
with:
name: dumps-${{ matrix.config.name }}
path: dumps
- name: Zip LSL Framework
run: |
cd install/Frameworks
zip -ry lsl.framework.zip lsl.framework
cd ../..
- name: Upload macOS Package and Framework
if: matrix.config.name == 'macOS-latest'
uses: actions/upload-artifact@v4
with:
name: build-macOS-latest
path: |
package/*.pkg
install/Frameworks/lsl.framework.zip
- name: Upload iOS Framework
if: matrix.config.name == 'iOS'
uses: actions/upload-artifact@v4
with:
name: build-iOS
path: install/Frameworks/lsl.framework.zip
- name: Upload iOS Simulator Framework
if: matrix.config.name == 'iOS Simulator'
uses: actions/upload-artifact@v4
with:
name: build-iOS-Simulator
path: install/Frameworks/lsl.framework.zip
xcframework_and_deploy:
name: XCFramework and Deploy
needs: build
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: build-macOS-latest
path: build-macOS-latest
- uses: actions/download-artifact@v4
with:
name: build-iOS
path: build-iOS
- uses: actions/download-artifact@v4
with:
name: build-iOS-Simulator
path: build-iOS-Simulator
- name: Unzip Frameworks
run: |
unzip build-macOS-latest/install/Frameworks/lsl.framework.zip -d build-macOS-latest/Frameworks
unzip build-iOS/lsl.framework.zip -d build-iOS/Frameworks
unzip build-iOS-Simulator/lsl.framework.zip -d build-iOS-Simulator/Frameworks
- name: Install certificates and provisioning profiles
uses: ./.github/actions/install-apple-certs
with:
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
- name: Create and Sign XCFramework
run: |
./scripts/apple_create_xcframework.sh \
--macos build-macOS-latest/Frameworks/lsl.framework \
--ios build-iOS/Frameworks/lsl.framework \
--ios-simulator build-iOS-Simulator/Frameworks/lsl.framework \
--output .
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: mac-packages
path: |
lsl.xcframework.*.zip
build-macOS-latest/package/
- name: Upload to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: |
lsl.xcframework.*.zip
build-macOS-latest/package/*.*