|
7 | 7 | permissions: |
8 | 8 | contents: write |
9 | 9 |
|
| 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 | + |
10 | 16 | jobs: |
11 | 17 | release-xcframework: |
12 | 18 | runs-on: macos-14 |
13 | 19 |
|
14 | | - env: |
15 | | - SDL3_VERSION: "release-3.4.10" |
16 | | - IOS_MIN: "14.0" |
17 | | - |
18 | 20 | steps: |
19 | | - - name: Install dependencies |
20 | | - run: brew install cmake |
21 | | - |
22 | | - - name: Checkout |
| 21 | + - name: Checkout Objectively |
23 | 22 | uses: actions/checkout@v6 |
| 23 | + with: |
| 24 | + repository: jdolan/Objectively |
| 25 | + ref: ${{ env.OBJECTIVELY_REF }} |
| 26 | + path: Objectively |
24 | 27 |
|
25 | | - - name: Cache xcframework build |
26 | | - uses: actions/cache@v4 |
| 28 | + - name: Checkout ObjectivelyGPU |
| 29 | + uses: actions/checkout@v6 |
27 | 30 | 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 |
32 | 38 |
|
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 |
34 | 48 | 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" |
40 | 67 |
|
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 |
43 | 73 |
|
44 | 74 | - name: Zip xcframeworks |
| 75 | + working-directory: ObjectivelyGPU/Frameworks |
45 | 76 | 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 |
49 | 79 |
|
50 | 80 | - name: Create release |
| 81 | + working-directory: ObjectivelyGPU |
51 | 82 | run: | |
52 | 83 | gh release delete ${{ github.ref_name }} --yes || true |
53 | 84 | gh release create ${{ github.ref_name }} \ |
54 | 85 | --title "ObjectivelyGPU ${{ github.ref_name }}" \ |
55 | 86 | --generate-notes \ |
56 | | - SDL3.xcframework.zip \ |
57 | | - ObjectivelyGPU.xcframework.zip |
| 87 | + "$GITHUB_WORKSPACE/SDL3.xcframework.zip" \ |
| 88 | + "$GITHUB_WORKSPACE/ObjectivelyGPU.xcframework.zip" |
58 | 89 | env: |
59 | 90 | GH_TOKEN: ${{ github.token }} |
0 commit comments