Skip to content

Commit 9f335b0

Browse files
committed
[rn] Use stable Hermes for dry-run builds on stable branches
The build_android workflow was incorrectly using for dry-run builds on stable branches (e.g., 0.85-stable), causing it to append suffix to the Hermes version. This resulted in trying to fetch non-existent SNAPSHOT artifacts like in https://github.com/facebook/react-native/actions/runs/22592250332/job/65471130298. This fix adds a check to detect stable branches (via github.ref_name or github.base_ref) and uses instead, which fetches the stable Hermes release from Maven Central without the -SNAPSHOT suffix. We check both github.ref_name and github.base_ref to cover two scenarios: ref_name: Direct pushes to stable branches (e.g. pushing to 0.85-stable) base_ref: Pull requests targeting stable branches (e.g. cherry-pick PRs where the source branch isn't named -stable but the target isChangelog: [Internal]
1 parent 4379f21 commit 9f335b0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/actions/build-android/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ runs:
5454
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
5555
# dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs.
5656
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
57-
export HERMES_PREBUILT_FLAG="ORG_GRADLE_PROJECT_react.internal.useHermesNightly=true"
57+
# Use stable Hermes on stable branches, nightly Hermes on main
58+
if [[ "${{ github.ref_name }}" == *"-stable" ]] || [[ "${{ github.base_ref }}" == *"-stable" ]]; then
59+
export HERMES_PREBUILT_FLAG="ORG_GRADLE_PROJECT_react.internal.useHermesStable=true"
60+
else
61+
export HERMES_PREBUILT_FLAG="ORG_GRADLE_PROJECT_react.internal.useHermesNightly=true"
62+
fi
5863
TASKS="publishAllToMavenTempLocal build"
5964
elif [[ "${{ inputs.release-type }}" == "nightly" ]]; then
6065
# nightly: we set isSnapshot to true so artifacts are sent to the right repository on Maven Central.

0 commit comments

Comments
 (0)