Skip to content

Commit dfb2ba6

Browse files
authored
ci: Add Mac Catalyst build (#168)
* Build for Catalyst * Always use Mac 14 * Only build Catalyst on ARM
1 parent 51ab079 commit dfb2ba6

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

.github/workflows/build-test-and-docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,44 @@ jobs:
126126
xcodebuild: true
127127
xcodebuild-device-type: ${{ matrix.device-type }}
128128

129+
uikit-catalyst:
130+
runs-on: macos-14
131+
steps:
132+
- name: Force Xcode 15.4
133+
run: sudo xcode-select -switch /Applications/Xcode_15.4.app
134+
135+
- name: Swift version
136+
run: swift --version
137+
138+
- name: Install xcbeautify
139+
run: brew install xcbeautify
140+
141+
- uses: actions/checkout@v3
142+
143+
- name: Build
144+
run: |
145+
set -uxo pipefail
146+
buildtarget () {
147+
# Use the same derived data path as DocC compilation so that we don't duplicate work.
148+
xcodebuild -derivedDataPath /tmp/data -skipMacroValidation -scheme "$1" -destination "variant=Mac Catalyst,arch=arm64,platform=macOS" build | xcbeautify --renderer github-actions
149+
}
150+
151+
buildtarget SwiftCrossUI
152+
buildtarget UIKitBackend
153+
154+
cd Examples
155+
156+
buildtarget CounterExample
157+
buildtarget GreetingGeneratorExample
158+
buildtarget NavigationExample
159+
buildtarget StressTestExample
160+
buildtarget NotesExample
161+
buildtarget PathsExample
162+
buildtarget ControlsExample
163+
buildtarget RandomNumberGeneratorExample
164+
# TODO test whether this works on Catalyst
165+
# buildtarget SplitExample
166+
129167
windows:
130168
runs-on: windows-latest
131169
defaults:

Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@
129129
"kind" : "remoteSourceControl",
130130
"location" : "https://github.com/the-swift-collective/zlib.git",
131131
"state" : {
132-
"revision" : "f35d438c14187cb369dfd82603c3427dc66fbed5",
133-
"version" : "1.3.1"
132+
"revision" : "f1d153b90420f9fcc6ef916cd67ea96f0e68d137",
133+
"version" : "1.3.2"
134134
}
135135
}
136136
],

Sources/UIKitBackend/UIKitBackend+Picker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ final class UITableViewPicker: WrapperWidget<UITableView>, Picker, UITableViewDe
142142
extension UIKitBackend {
143143
public func createPicker() -> Widget {
144144
#if targetEnvironment(macCatalyst)
145-
if UIDevice.current.userInterfaceIdiom == .mac {
145+
if #available(macCatalyst 14, *), UIDevice.current.userInterfaceIdiom == .mac {
146146
return UITableViewPicker()
147147
} else {
148148
return UIPickerViewPicker()

0 commit comments

Comments
 (0)