Skip to content

Commit 994ed5e

Browse files
committed
Use proper framework targets
1 parent d411d54 commit 994ed5e

6 files changed

Lines changed: 149 additions & 422 deletions

File tree

.github/workflows/release.yml

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,84 @@ on:
77
permissions:
88
contents: write
99

10+
env:
11+
# Objectively is a source dependency (resolved via ObjectivelyGPU.xcworkspace).
12+
# Override to point a GPU release/branch at a specific Objectively ref.
13+
# SDL3 / curl versions live in fetch-sdl3.sh / build-libcurl.sh, not here.
14+
OBJECTIVELY_REF: "main"
15+
1016
jobs:
1117
release-xcframework:
1218
runs-on: macos-14
1319

14-
env:
15-
SDL3_VERSION: "release-3.4.10"
16-
IOS_MIN: "14.0"
17-
1820
steps:
19-
- name: Install dependencies
20-
run: brew install cmake
21-
22-
- name: Checkout
21+
- name: Checkout Objectively
2322
uses: actions/checkout@v6
23+
with:
24+
repository: jdolan/Objectively
25+
ref: ${{ env.OBJECTIVELY_REF }}
26+
path: Objectively
2427

25-
- name: Cache xcframework build
26-
uses: actions/cache@v4
28+
- name: Checkout ObjectivelyGPU
29+
uses: actions/checkout@v6
2730
with:
28-
path: .build-xcframework
29-
key: xcframework-${{ env.SDL3_VERSION }}-ios-${{ env.IOS_MIN }}-${{ hashFiles('Sources/ObjectivelyGPU/**/*.c', 'Sources/ObjectivelyGPU/**/*.h', 'Frameworks/build-xcframework.sh') }}
30-
restore-keys: |
31-
xcframework-${{ env.SDL3_VERSION }}-ios-${{ env.IOS_MIN }}-
31+
path: ObjectivelyGPU
32+
33+
# curl ships no prebuilt xcframework; build it so the iOS slices have curl
34+
# headers for the Objectively source dependency. macOS uses system curl.
35+
- name: Build libcurl.xcframework
36+
working-directory: Objectively
37+
run: ./Frameworks/build-libcurl.sh
3238

33-
- name: Download Objectively xcframework
39+
- name: Fetch SDL3.xcframework
40+
working-directory: ObjectivelyGPU
41+
run: ./Frameworks/fetch-sdl3.sh
42+
43+
# Archive the framework target (single source of truth — no duplicated file
44+
# list) per platform, then combine. iOS compiles the Objectively dep from
45+
# source, so feed curl's headers with an additive -I.
46+
- name: Build ObjectivelyGPU.xcframework
47+
working-directory: ObjectivelyGPU
3448
run: |
35-
mkdir -p Frameworks
36-
gh release download --repo jdolan/Objectively --pattern "Objectively.xcframework.zip" -D Frameworks/
37-
cd Frameworks && unzip -q Objectively.xcframework.zip && rm Objectively.xcframework.zip
38-
env:
39-
GH_TOKEN: ${{ github.token }}
49+
set -euo pipefail
50+
rm -rf build
51+
curl_ios="$GITHUB_WORKSPACE/Objectively/Frameworks/libcurl.xcframework/ios-arm64/Headers"
52+
curl_sim="$GITHUB_WORKSPACE/Objectively/Frameworks/libcurl.xcframework/ios-arm64_x86_64-simulator/Headers"
53+
54+
xcodebuild archive -workspace ObjectivelyGPU.xcworkspace -scheme ObjectivelyGPU \
55+
-destination "generic/platform=macOS" -archivePath build/macOS \
56+
SKIP_INSTALL=NO CODE_SIGNING_ALLOWED=NO
57+
58+
xcodebuild archive -workspace ObjectivelyGPU.xcworkspace -scheme ObjectivelyGPU \
59+
-destination "generic/platform=iOS" -archivePath build/iOS \
60+
SKIP_INSTALL=NO CODE_SIGNING_ALLOWED=NO \
61+
OTHER_CFLAGS="\$(inherited) -I$curl_ios"
62+
63+
xcodebuild archive -workspace ObjectivelyGPU.xcworkspace -scheme ObjectivelyGPU \
64+
-destination "generic/platform=iOS Simulator" -archivePath build/iOS_Simulator \
65+
SKIP_INSTALL=NO CODE_SIGNING_ALLOWED=NO \
66+
OTHER_CFLAGS="\$(inherited) -I$curl_sim"
4067
41-
- name: Build xcframeworks
42-
run: bash Frameworks/build-xcframework.sh
68+
xcodebuild -create-xcframework \
69+
-framework build/macOS.xcarchive/Products/Library/Frameworks/ObjectivelyGPU.framework \
70+
-framework build/iOS.xcarchive/Products/Library/Frameworks/ObjectivelyGPU.framework \
71+
-framework build/iOS_Simulator.xcarchive/Products/Library/Frameworks/ObjectivelyGPU.framework \
72+
-output Frameworks/ObjectivelyGPU.xcframework
4373
4474
- name: Zip xcframeworks
75+
working-directory: ObjectivelyGPU/Frameworks
4576
run: |
46-
cd Frameworks
47-
zip -r ../SDL3.xcframework.zip SDL3.xcframework
48-
zip -r ../ObjectivelyGPU.xcframework.zip ObjectivelyGPU.xcframework
77+
zip -r "$GITHUB_WORKSPACE/SDL3.xcframework.zip" SDL3.xcframework
78+
zip -r "$GITHUB_WORKSPACE/ObjectivelyGPU.xcframework.zip" ObjectivelyGPU.xcframework
4979
5080
- name: Create release
81+
working-directory: ObjectivelyGPU
5182
run: |
5283
gh release delete ${{ github.ref_name }} --yes || true
5384
gh release create ${{ github.ref_name }} \
5485
--title "ObjectivelyGPU ${{ github.ref_name }}" \
5586
--generate-notes \
56-
SDL3.xcframework.zip \
57-
ObjectivelyGPU.xcframework.zip
87+
"$GITHUB_WORKSPACE/SDL3.xcframework.zip" \
88+
"$GITHUB_WORKSPACE/ObjectivelyGPU.xcframework.zip"
5889
env:
5990
GH_TOKEN: ${{ github.token }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
*~
88
.DS_Store
99
.build-xcframework/
10-
.build-xcframework/
1110
.deps/
1211
.dirstamp
1312
.libs/
1413
Config.h
1514
Config.h.in
1615
Examples/Hello
1716
Examples/HelloCompute
18-
Frameworks/
17+
Frameworks/*
18+
!Frameworks/*.sh
1919
Makefile
2020
Makefile.in
2121
ObjectivelyGPU.vs15/libs/

0 commit comments

Comments
 (0)