Skip to content

Commit 0fb0bd1

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Add headers to XCFramework (facebook#52010)
Summary: We found out that the XCFramework that is generated in CI is missing the headers. This is happening because we run the setup script, the responsible to prepare the folder structure with the heaeders in the right place, only in the job that builds the slices. However, the headers are copied by the job that composes the XCFramework. This change stores the header folder as an artifact in the build job and retrieves it in the compose job, so that the files are available to the XCFramework ## Changelog: [Internal] - Pull Request resolved: facebook#52010 Test Plan: Check the generated artefact in CI <img width="292" alt="Screenshot 2025-06-13 at 15 32 02" src="https://github.com/user-attachments/assets/437333da-5848-4657-a9b3-e87fc79c69b2" /> Reviewed By: cortinico Differential Revision: D76599834 Pulled By: cipolleschi fbshipit-source-id: 44d74b5f8df545a825ecfe3df2e1898effe41261
1 parent 6b9d931 commit 0fb0bd1

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/prebuild-ios-core.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
id: restore-ios-slice
2424
uses: actions/cache/restore@v4
2525
with:
26-
path: packages/react-native/third-party/
27-
key: v2-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
26+
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
27+
path: packages/react-native/
2828
- name: Setup node.js
2929
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
3030
uses: ./.github/actions/setup-node
@@ -101,6 +101,12 @@ jobs:
101101
# This is going to be replaced by a CLI script
102102
cd packages/react-native
103103
node scripts/ios-prebuild -b -f "${{ matrix.flavor }}" -p "${{ matrix.slice }}"
104+
- name: Upload headers
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: prebuild-ios-core-headers-${{ matrix.flavor }}-${{ matrix.slice }}
108+
path:
109+
packages/react-native/.build/headers
104110
- name: Upload artifacts
105111
uses: actions/[email protected]
106112
with:
@@ -111,10 +117,10 @@ jobs:
111117
uses: actions/cache/save@v4
112118
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
113119
with:
114-
key: v2-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
115-
enableCrossOsArchive: true
120+
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
116121
path: |
117122
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
123+
packages/react-native/.build/headers
118124
119125
compose-xcframework:
120126
runs-on: macos-14
@@ -153,6 +159,13 @@ jobs:
153159
pattern: prebuild-ios-core-slice-${{ matrix.flavor }}-*
154160
path: packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
155161
merge-multiple: true
162+
- name: Download headers
163+
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
164+
uses: actions/download-artifact@v4
165+
with:
166+
pattern: prebuild-ios-core-headers-${{ matrix.flavor }}-*
167+
path: packages/react-native/.build/headers
168+
merge-multiple: true
156169
- name: Setup Keychain
157170
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
158171
uses: apple-actions/import-codesign-certs@v3 # https://github.com/marketplace/actions/import-code-signing-certificates

0 commit comments

Comments
 (0)