Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6af68ac
feat(ci): compose and cache prebuilt React xcframework from SPM build
Saadnajmi Apr 15, 2026
e64d7af
fix(ci): add macOS and visionOS to extractDestinationFromPath
Saadnajmi Apr 15, 2026
817c45a
feat(ci): add content-hash caching for SPM slice and compose jobs
Saadnajmi Apr 17, 2026
95e3d7c
feat(ci): skip Hermes build-from-source when upstream tarball has mac…
Saadnajmi Apr 17, 2026
3ea3c9a
fix(ci): use mapped upstream version for Hermes version marker
Saadnajmi Apr 17, 2026
821930a
ci: rename Build SwiftPM workflow to Prebuild macOS Core
Saadnajmi Apr 17, 2026
25cd393
ci: use microsoft-setup-toolchain for Hermes build jobs
Saadnajmi Apr 17, 2026
5b59e95
fix: use BuildFlavor type for checkUpstreamHermesHasMacOS parameter
Saadnajmi Apr 17, 2026
2062b58
ci: extract Hermes build into separate reusable workflow
Saadnajmi Apr 17, 2026
5500b3d
ci: rename Build Hermes workflow to Resolve Hermes
Saadnajmi Apr 17, 2026
7c1a307
fix: check xcframework Info.plist for mac slice, not just macosx/ dir
Saadnajmi Apr 18, 2026
6d4c48b
feat(ci): recompose upstream Hermes xcframework with macOS slice
Saadnajmi Apr 18, 2026
55a8973
refactor: rename macosVersionResolver → microsoft-resolveHermes
Saadnajmi Apr 18, 2026
ad7f482
refactor: add CLI entry point, recompose function, and flow comments
Saadnajmi Apr 18, 2026
4e396cd
fix(ci): save cache on any stable branch, not just 0.81-stable
Saadnajmi Apr 18, 2026
a30b944
refactor: move CI scripts to .github/scripts/resolve-hermes.mts
Saadnajmi Apr 18, 2026
432bdf0
refactor: move downloadUpstreamHermesTarball to CI script
Saadnajmi Apr 18, 2026
b40ac21
refactor: rename to microsoft-hermes, use parseArgs, add PR links
Saadnajmi Apr 18, 2026
0a168fb
fix(ci): use createRequire to import CommonJS from ESM script
Saadnajmi Apr 18, 2026
437f07d
merge: resolve conflict with upstream/main
Saadnajmi Apr 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/microsoft-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ jobs:
permissions: {}
uses: ./.github/workflows/microsoft-build-rntester.yml

build-spm:
name: "Build SPM"
prebuild-macos-core:
name: "Prebuild macOS Core"
permissions: {}
uses: ./.github/workflows/microsoft-build-spm.yml
uses: ./.github/workflows/microsoft-prebuild-macos-core.yml

test-react-native-macos-init:
name: "Test react-native-macos init"
Expand All @@ -168,7 +168,7 @@ jobs:
- yarn-constraints
- javascript-tests
- build-rntester
- build-spm
- prebuild-macos-core
- test-react-native-macos-init
# - react-native-test-app-integration
steps:
Expand Down
185 changes: 185 additions & 0 deletions .github/workflows/microsoft-prebuild-macos-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: Prebuild macOS Core

on:
workflow_call:

jobs:
resolve-hermes:
name: "Resolve Hermes"
uses: ./.github/workflows/microsoft-resolve-hermes.yml

build:
name: "Build ${{ matrix.platform }}"
needs: [resolve-hermes]
runs-on: macos-26
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
platform: [ios, ios-simulator, macos, visionos, visionos-simulator]
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0

- name: Restore slice cache
id: cache-slice
uses: actions/cache/restore@v4
with:
key: v1-macos-core-${{ matrix.platform }}-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/spm/Debug/Build/Products
packages/react-native/.build/headers

- name: Setup toolchain
if: steps.cache-slice.outputs.cache-hit != 'true'
uses: ./.github/actions/microsoft-setup-toolchain
with:
node-version: '22'
platform: ${{ matrix.platform }}

- name: Install npm dependencies
if: steps.cache-slice.outputs.cache-hit != 'true'
run: yarn install

- name: Download Hermes artifacts
if: steps.cache-slice.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
name: hermes-artifacts
path: packages/react-native/.build/artifacts/hermes/destroot

- name: Create Hermes version marker
if: steps.cache-slice.outputs.cache-hit != 'true'
working-directory: packages/react-native
run: |
echo "prebuilt-Debug" > .build/artifacts/hermes/version.txt

- name: Setup workspace (using prebuilt Hermes)
if: steps.cache-slice.outputs.cache-hit != 'true'
working-directory: packages/react-native
env:
HERMES_VERSION: prebuilt
run: node scripts/ios-prebuild.js -s -f Debug

- name: Build (${{ matrix.platform }})
if: steps.cache-slice.outputs.cache-hit != 'true'
working-directory: packages/react-native
run: node scripts/ios-prebuild.js -b -f Debug -p ${{ matrix.platform }}

- name: Save slice cache
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/0.81-stable' }}
uses: actions/cache/save@v4
with:
key: v1-macos-core-${{ matrix.platform }}-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/spm/Debug/Build/Products
packages/react-native/.build/headers

- name: Upload headers
uses: actions/upload-artifact@v4
with:
name: prebuild-macos-core-headers-Debug-${{ matrix.platform }}
path: packages/react-native/.build/headers

- name: Upload slice artifacts
uses: actions/upload-artifact@v4
with:
name: prebuild-macos-core-slice-Debug-${{ matrix.platform }}
path: packages/react-native/.build/output/spm/Debug/Build/Products

compose-xcframework:
name: "Compose XCFramework (Debug)"
needs: [build]
if: ${{ always() && !cancelled() && !failure() }}
runs-on: macos-26
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
filter: blob:none

- name: Restore compose cache
id: cache-xcframework
uses: actions/cache/restore@v4
with:
key: v1-macos-core-xcframework-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/xcframeworks/ReactCoreDebug.xcframework.tar.gz
packages/react-native/.build/output/xcframeworks/ReactCoreDebug.framework.dSYM.tar.gz

- name: Setup toolchain
if: steps.cache-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/microsoft-setup-toolchain
with:
node-version: '22'
platform: ios

- name: Install npm dependencies
if: steps.cache-xcframework.outputs.cache-hit != 'true'
run: yarn install

- name: Download slice artifacts
if: steps.cache-xcframework.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
pattern: prebuild-macos-core-slice-Debug-*
path: packages/react-native/.build/output/spm/Debug/Build/Products
merge-multiple: true

- name: Download headers
if: steps.cache-xcframework.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
pattern: prebuild-macos-core-headers-Debug-*
path: packages/react-native/.build/headers
merge-multiple: true

- name: Verify downloaded artifacts
if: steps.cache-xcframework.outputs.cache-hit != 'true'
run: |
echo "=== Products directory ==="
ls -R packages/react-native/.build/output/spm/Debug/Build/Products/ | head -40
echo "=== Headers directory ==="
ls packages/react-native/.build/headers/ | head -20

- name: Create XCFramework
if: steps.cache-xcframework.outputs.cache-hit != 'true'
working-directory: packages/react-native
run: node scripts/ios-prebuild -c -f Debug

- name: Compress XCFramework
if: steps.cache-xcframework.outputs.cache-hit != 'true'
run: |
cd packages/react-native/.build/output/xcframeworks/Debug
tar -cz -f ../ReactCoreDebug.xcframework.tar.gz React.xcframework

- name: Compress dSYMs
if: steps.cache-xcframework.outputs.cache-hit != 'true'
run: |
cd packages/react-native/.build/output/xcframeworks/Debug/Symbols
tar -cz -f ../../ReactCoreDebug.framework.dSYM.tar.gz .

- name: Save compose cache
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/0.81-stable' }}
uses: actions/cache/save@v4
with:
key: v1-macos-core-xcframework-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/xcframeworks/ReactCoreDebug.xcframework.tar.gz
packages/react-native/.build/output/xcframeworks/ReactCoreDebug.framework.dSYM.tar.gz

- name: Upload XCFramework
uses: actions/upload-artifact@v4
with:
name: ReactCoreDebug.xcframework.tar.gz
path: packages/react-native/.build/output/xcframeworks/ReactCoreDebug.xcframework.tar.gz
retention-days: 14

- name: Upload dSYMs
uses: actions/upload-artifact@v4
with:
name: ReactCoreDebug.framework.dSYM.tar.gz
path: packages/react-native/.build/output/xcframeworks/ReactCoreDebug.framework.dSYM.tar.gz
retention-days: 14
Loading
Loading