From 790860782e07c02b3d89742006d9e73fea62bcfc Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Mon, 3 Nov 2025 03:29:38 -0800 Subject: [PATCH] fix: iOS version mismatch when using nightly prebuilds (#54370) Summary: Setting `ENV['RCT_USE_PREBUILT_RNCORE'] = '1'` when running nightlies on iOS will result in the following error: image The reason for this happening is that we precompile the iOS artifacts on CI using whatever version is set on main (by default version 1000). This works fine when using RCs and stable versions because before the publishing step we do a release commit (e.g https://github.com/facebook/react-native/commit/57ff54492f4a5a0e9d331e880b3c2264a2bd81f7), which updates the react-native version. This can be easily mitigated by invoking the `set-rn-artifacts-version` CLI right before building the iOS prebuilds. ## Changelog: [IOS] [FIXED] - Fix iOS version mismatch when using nightly prebuilds Pull Request resolved: https://github.com/facebook/react-native/pull/54370 Test Plan: Run `node ./scripts/releases/set-rn-artifacts-version.js --build-type` locally Reviewed By: javache Differential Revision: D86089144 Pulled By: cipolleschi fbshipit-source-id: a5c296ea8e022e562f7898803ab37dc61ffd67b6 --- .github/workflows/nightly.yml | 1 + .github/workflows/prebuild-ios-core.yml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a56e7388e1f..e9ce8cc2d91 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,6 +30,7 @@ jobs: uses: ./.github/workflows/prebuild-ios-core.yml with: use-hermes-nightly: true + version-type: nightly secrets: inherit needs: [prebuild_apple_dependencies] diff --git a/.github/workflows/prebuild-ios-core.yml b/.github/workflows/prebuild-ios-core.yml index 5a181760863..5e234961fc5 100644 --- a/.github/workflows/prebuild-ios-core.yml +++ b/.github/workflows/prebuild-ios-core.yml @@ -1,8 +1,13 @@ -name: Prebuild iOS Dependencies +name: Prebuild iOS Core on: workflow_call: # this directive allow us to call this workflow from other workflows inputs: + version-type: + description: 'The version type to set for the prebuild (nightly or release)' + type: string + required: false + default: '' use-hermes-nightly: description: 'Whether to use the hermes nightly build or read the version from the versions.properties file' type: boolean @@ -51,6 +56,12 @@ jobs: fi echo "Using Hermes version: $HERMES_VERSION" echo "HERMES_VERSION=$HERMES_VERSION" >> $GITHUB_ENV + - name: Set React Native version + shell: bash + run: | + if [ "${{ inputs.version-type }}" != "" ]; then + node ./scripts/releases/set-rn-artifacts-version.js --build-type "${{ inputs.version-type }}" + fi - name: Download ReactNativeDependencies uses: actions/download-artifact@v4 with: