Skip to content

Commit 2ff0220

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Add job to build the XCFramework for ios prebuilds (facebook#49563)
Summary: Pull Request resolved: facebook#49563 This change introduces a job to prebuild iOS XCFrameworks. ## Changelog: [Internal] - Create prepare artifacts workflows Reviewed By: cortinico Differential Revision: D69924325 fbshipit-source-id: f2241b1db715ae7c42ce32eda55a54efa6985a9d
1 parent da88bf0 commit 2ff0220

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

.github/workflows/prebuild-ios.yml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
- name: Upload Artifacts
101101
uses: actions/[email protected]
102102
with:
103-
name: ios-slice-${{ matrix.flavor }}-${{ matrix.slice }}
103+
name: prebuild-slice-${{ matrix.flavor }}-${{ matrix.slice }}
104104
path: |
105105
packages/react-native/third-party/.build/Build/Products
106106
- name: Save Cache
@@ -111,3 +111,57 @@ jobs:
111111
enableCrossOsArchive: true
112112
path: |
113113
packages/react-native/third-party/.build/Build/Products
114+
115+
create-xcframework:
116+
name: Prepare XCFramework
117+
runs-on: macos-14
118+
needs: [build-apple-slices]
119+
strategy:
120+
fail-fast: false
121+
matrix:
122+
flavor: [Debug, Release]
123+
steps:
124+
- name: Checkout
125+
uses: actions/checkout@v4
126+
- name: Setup node.js
127+
uses: ./.github/actions/setup-node
128+
- name: Setup xcode
129+
uses: ./.github/actions/setup-xcode
130+
with:
131+
xcode-version: '16.1'
132+
- name: Restore XCFramework
133+
id: restore-xcframework
134+
uses: actions/cache/restore@v4
135+
with:
136+
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
137+
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}
138+
# If cache hit, we already have our binary. We don't need to do anything.
139+
- name: Yarn Install
140+
if: steps.restore-xcframework.outputs.cache-hit != 'true'
141+
uses: ./.github/actions/yarn-install
142+
- name: Download slices
143+
if: steps.restore-xcframework.outputs.cache-hit != 'true'
144+
uses: actions/download-artifact@v4
145+
with:
146+
pattern: prebuild-slice-${{ matrix.flavor }}-*
147+
path: packages/react-native/third-party/.build/Build/Products
148+
merge-multiple: true
149+
- name: Create XCFramework
150+
if: steps.restore-xcframework.outputs.cache-hit != 'true'
151+
run: node scripts/releases/prepare-ios-prebuilds.js -c
152+
- name: Rename XCFramework
153+
if: steps.restore-xcframework.outputs.cache-hit != 'true'
154+
run: mv packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
155+
- name: Upload XCFramework Artifact
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework
159+
path: |
160+
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
161+
- name: Save XCFramework in Cache
162+
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
163+
uses: actions/cache/save@v4
164+
with:
165+
path: |
166+
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
167+
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}

0 commit comments

Comments
 (0)