Skip to content

Commit 9519806

Browse files
authored
Add support for iOS and the static SDK (#25)
1 parent 30a30d5 commit 9519806

File tree

5 files changed

+69
-10
lines changed

5 files changed

+69
-10
lines changed

.github/workflows/build-temporal-core-artifacts.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ jobs:
143143
rustup target add aarch64-apple-ios
144144
rustup target add x86_64-apple-ios
145145
rustup target add aarch64-apple-ios-sim
146+
rustup target add x86_64-apple-ios-macabi
147+
rustup target add aarch64-apple-ios-macabi
146148
147149
- name: Build macOS x86_64
148150
run: |
@@ -219,6 +221,36 @@ jobs:
219221
--features xz2-static \
220222
--crate-type=staticlib
221223
224+
- name: Build macOS Catalyst x86_64
225+
run: |
226+
export PATH="$PATH:$HOME/.local/bin"
227+
. "$HOME/.cargo/env"
228+
cd ${{ env.RUST_PROJECT_DIR }}
229+
MACOSX_DEPLOYMENT_TARGET="15" \
230+
IPHONEOS_DEPLOYMENT_TARGET="18" \
231+
TVOS_DEPLOYMENT_TARGET="18" \
232+
WATCHOS_DEPLOYMENT_TARGET="11" \
233+
cargo rustc \
234+
--release \
235+
--target x86_64-apple-ios-macabi \
236+
--features xz2-static \
237+
--crate-type=staticlib
238+
239+
- name: Build macOS Catalyst arm64
240+
run: |
241+
export PATH="$PATH:$HOME/.local/bin"
242+
. "$HOME/.cargo/env"
243+
cd ${{ env.RUST_PROJECT_DIR }}
244+
MACOSX_DEPLOYMENT_TARGET="15" \
245+
IPHONEOS_DEPLOYMENT_TARGET="18" \
246+
TVOS_DEPLOYMENT_TARGET="18" \
247+
WATCHOS_DEPLOYMENT_TARGET="11" \
248+
cargo rustc \
249+
--release \
250+
--target aarch64-apple-ios-macabi \
251+
--features xz2-static \
252+
--crate-type=staticlib
253+
222254
- name: Create fat library
223255
run: |
224256
X86_64_LIB="dependencies/sdk-core/target/x86_64-apple-darwin/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}"
@@ -258,17 +290,26 @@ jobs:
258290
-output "libtemporal_ios_sim.a"
259291
echo "✅ iOS simulator library: libtemporal_ios_sim.a"
260292
293+
# macOS Catalyst
294+
lipo -create \
295+
"dependencies/sdk-core/target/x86_64-apple-ios-macabi/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}" \
296+
"dependencies/sdk-core/target/aarch64-apple-ios-macabi/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}" \
297+
-output "libtemporal_catalyst.a"
298+
echo "✅ macOS Catalyst library: libtemporal_catalyst.a"
299+
261300
- name: Create XCFramework
262301
run: |
263302
# Create temporary directories for each platform
264303
mkdir -p temp_macos/Headers
265304
mkdir -p temp_ios/Headers
266305
mkdir -p temp_ios_sim/Headers
306+
mkdir -p temp_catalyst/Headers
267307
268308
# Copy libraries and headers to each platform directory
269309
cp "libtemporal_fat.a" "temp_macos/libTemporal.a"
270310
cp "libtemporal_ios.a" "temp_ios/libTemporal.a"
271311
cp "libtemporal_ios_sim.a" "temp_ios_sim/libTemporal.a"
312+
cp "libtemporal_catalyst.a" "temp_catalyst/libTemporal.a"
272313
273314
# Copy headers to all platform directories
274315
for dir in temp_*/Headers; do
@@ -287,6 +328,7 @@ jobs:
287328
-library "temp_macos/libTemporal.a" -headers "temp_macos/Headers" \
288329
-library "temp_ios/libTemporal.a" -headers "temp_ios/Headers" \
289330
-library "temp_ios_sim/libTemporal.a" -headers "temp_ios_sim/Headers" \
331+
-library "temp_catalyst/libTemporal.a" -headers "temp_catalyst/Headers" \
290332
-output "${{ env.XCFRAMEWORK_NAME }}"
291333
292334
# Clean up temporary files
@@ -305,6 +347,8 @@ jobs:
305347
dependencies/sdk-core/target/aarch64-apple-ios/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}
306348
dependencies/sdk-core/target/x86_64-apple-ios/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}
307349
dependencies/sdk-core/target/aarch64-apple-ios-sim/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}
350+
dependencies/sdk-core/target/x86_64-apple-ios-macabi/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}
351+
dependencies/sdk-core/target/aarch64-apple-ios-macabi/release/${{ env.TEMPORAL_BUILT_LIB_NAME }}
308352
${{ env.XCFRAMEWORK_NAME }}
309353
retention-days: 1
310354

.github/workflows/pull_request.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ jobs:
2222
linux_nightly_next_arguments_override: "-Xswiftc -require-explicit-sendable"
2323
linux_nightly_main_arguments_override: "-Xswiftc -require-explicit-sendable"
2424

25+
macos-tests:
26+
name: macOS tests
27+
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
28+
with:
29+
runner_pool: general
30+
build_scheme: swift-temporal-sdk-Package
31+
xcode_16_3_enabled: false
32+
xcode_16_4_enabled: false
33+
watchos_xcode_build_enabled: false
34+
tvos_xcode_build_enabled: false
35+
visionos_xcode_build_enabled: false
36+
secrets: inherit
37+
38+
static-sdk:
39+
name: Static Linux Swift SDK
40+
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
41+
2542
cxx-interop:
2643
name: Cxx interop
2744
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main

Package.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ let package = Package(
88
platforms: [
99
.macOS(.v15),
1010
.iOS(.v18),
11-
.tvOS(.v18),
12-
.watchOS(.v11),
1311
],
1412
products: [
1513
.library(
@@ -50,13 +48,13 @@ let package = Package(
5048
targets: [
5149
.binaryTarget(
5250
name: "Bridge",
53-
url: "https://github.com/apple/swift-temporal-sdk/releases/download/temporal-sdk-core-682d441-6/temporal.artifactbundle.zip",
54-
checksum: "c9c2e8f709e3b05362cae68a9ae45a437a1212b435e38d150e8925bded0a0973"
51+
url: "https://github.com/apple/swift-temporal-sdk/releases/download/temporal-sdk-core-682d441-1/temporal.artifactbundle.zip",
52+
checksum: "657ae88ac10ba93b6f1b282a30940d99c3df5a840473526570be6b01328c4afc"
5553
),
5654
.binaryTarget(
5755
name: "BridgeDarwin",
58-
url: "https://github.com/apple/swift-temporal-sdk/releases/download/temporal-sdk-core-682d441-6/temporal.xcframework.zip",
59-
checksum: "70a1a83a349058a0e2d422331012184256ee70199e6bb9f1cb946794f8bf8c7f"
56+
url: "https://github.com/apple/swift-temporal-sdk/releases/download/temporal-sdk-core-682d441-1/temporal.xcframework.zip",
57+
checksum: "7a6dd660d317b59be6ad79991c0ad73d8e5c809808f93777c8f13bdd439d87db"
6058
),
6159
.target(
6260
name: "Temporal",
@@ -84,10 +82,8 @@ let package = Package(
8482
.when(
8583
platforms: [
8684
.macOS,
85+
.macCatalyst,
8786
.iOS,
88-
.tvOS,
89-
.watchOS,
90-
.visionOS,
9187
]
9288
)
9389
),

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ business logic in a scalable and resilient way.
66

77
- 🚀 Swift package for authoring Temporal workflows and activities
88
- 📦 Compatible with Swift Package Manager
9-
- 📱 Supports Linux and macOS
9+
- 📱 Supports Linux (including the static SDK), macOS, iOS
1010
- 🔧 Built with Swift 6.2+ and Xcode 26+
1111

1212
🔗 Jump to:

Sources/TemporalTestKit/TemporalTestServer.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15+
#if canImport(Testing)
1516
import GRPCNIOTransportHTTP2Posix
1617
import Logging
1718
import Temporal
@@ -552,3 +553,4 @@ extension Trait where Self == TemporalTimeSkippingTestServerTrait {
552553
Self()
553554
}
554555
}
556+
#endif

0 commit comments

Comments
 (0)