Skip to content

Commit 3be0d37

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Use the Hermes artifacts in actions (#53837)
Summary: Pull Request resolved: #53837 Changelog: [Internal] Differential Revision: D82721725
1 parent 0562978 commit 3be0d37

File tree

7 files changed

+19
-94
lines changed

7 files changed

+19
-94
lines changed

.github/actions/test-ios-helloworld/action.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,16 @@ runs:
2525
uses: ./.github/actions/setup-node
2626
- name: Run yarn install
2727
uses: ./.github/actions/yarn-install
28-
- name: Create Hermes folder
29-
shell: bash
30-
run: mkdir -p "$HERMES_WS_DIR"
31-
- name: Download Hermes
32-
uses: actions/download-artifact@v4
33-
with:
34-
name: hermes-darwin-bin-${{ inputs.flavor }}
35-
path: /tmp/hermes/hermes-runtime-darwin/
36-
- name: Print Downloaded hermes
37-
shell: bash
38-
run: ls -lR "$HERMES_WS_DIR"
3928
- name: Setup ruby
4029
uses: ruby/setup-ruby@v1
4130
with:
4231
ruby-version: ${{ inputs.ruby-version }}
32+
- name: Set nightly Hermes versions
33+
shell: bash
34+
run: |
35+
node ./scripts/releases/set-hermes-versions.js --nightly
36+
- name: Run yarn install again, with the correct hermes version
37+
uses: ./.github/actions/yarn-install
4338
- name: Download ReactNativeDependencies
4439
uses: actions/download-artifact@v4
4540
with:
@@ -66,20 +61,6 @@ runs:
6661
args+=(--frameworks dynamic)
6762
fi
6863
69-
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
70-
# Let's ensure that the tarballs have the right names
71-
72-
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
73-
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
74-
fi
75-
76-
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
77-
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
78-
fi
79-
80-
BUILD_TYPE="${{ inputs.flavor }}"
81-
TARBALL_FILENAME=$(node ../../packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
82-
export HERMES_ENGINE_TARBALL_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
8364
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
8465
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
8566

.github/actions/test-ios-rntester/action.yml

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ inputs:
1010
run-unit-tests:
1111
description: whether unit tests should run or not.
1212
default: "false"
13-
hermes-tarball-artifacts-dir:
14-
description: The directory where the hermes tarball artifacts are stored
15-
default: /tmp/hermes/hermes-runtime-darwin
1613
flavor:
1714
description: The flavor of the build. Must be one of "Debug", "Release".
1815
default: Debug
@@ -36,56 +33,19 @@ runs:
3633
uses: ./.github/actions/setup-node
3734
- name: Run yarn
3835
uses: ./.github/actions/yarn-install
39-
- name: Download Hermes
40-
uses: actions/download-artifact@v4
41-
with:
42-
name: hermes-darwin-bin-${{ inputs.flavor }}
43-
path: ${{ inputs.hermes-tarball-artifacts-dir }}
4436
- name: Setup ruby
4537
uses: ruby/setup-ruby@v1
4638
with:
4739
ruby-version: ${{ inputs.ruby-version }}
40+
- name: Set nightly Hermes versions
41+
shell: bash
42+
run: |
43+
node ./scripts/releases/set-hermes-versions.js --nightly
44+
- name: Run yarn install again, with the correct hermes version
45+
uses: ./.github/actions/yarn-install
4846
- name: Prepare IOS Tests
4947
if: ${{ inputs.run-unit-tests == 'true' }}
5048
uses: ./.github/actions/prepare-ios-tests
51-
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
52-
shell: bash
53-
run: |
54-
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
55-
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
56-
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
57-
exit 0
58-
fi
59-
60-
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
61-
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
62-
63-
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
64-
echo "$TARBALL_PATH"
65-
66-
if [ ! -f $TARBALL_PATH ]; then
67-
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
68-
exit 0
69-
fi
70-
71-
echo "Found Hermes tarball at $TARBALL_PATH"
72-
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
73-
- name: Print Hermes version
74-
shell: bash
75-
run: |
76-
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
77-
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
78-
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
79-
if [[ -e $TARBALL_PATH ]]; then
80-
tar -xf $TARBALL_PATH
81-
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
82-
chmod +x ./destroot/bin/hermes
83-
./destroot/bin/hermes test.js
84-
rm test.js
85-
rm -rf destroot
86-
else
87-
echo 'No Hermes tarball found.'
88-
fi
8949
- name: Download ReactNativeDependencies
9050
uses: actions/download-artifact@v4
9151
with:
@@ -105,7 +65,6 @@ runs:
10565
- name: Install CocoaPods dependencies
10666
shell: bash
10767
run: |
108-
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
10968
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
11069
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
11170
@@ -116,6 +75,7 @@ runs:
11675
cd packages/rn-tester
11776
11877
bundle install
78+
bundle exec pod update hermes-engine --no-repo-update
11979
bundle exec pod install
12080
- name: Build RNTester
12181
shell: bash

.github/workflows/test-all.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ jobs:
127127
runs-on: macos-14
128128
needs:
129129
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
130-
env:
131-
HERMES_WS_DIR: /tmp/hermes
132-
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
133130
steps:
134131
- name: Checkout
135132
uses: actions/checkout@v4
@@ -145,9 +142,6 @@ jobs:
145142
runs-on: macos-14-large
146143
needs:
147144
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
148-
env:
149-
HERMES_WS_DIR: /tmp/hermes
150-
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
151145
continue-on-error: true
152146
strategy:
153147
fail-fast: false
@@ -169,9 +163,6 @@ jobs:
169163
runs-on: macos-14-large
170164
needs:
171165
[test_ios_rntester]
172-
env:
173-
HERMES_WS_DIR: /tmp/hermes
174-
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
175166
strategy:
176167
fail-fast: false
177168
matrix:
@@ -259,9 +250,6 @@ jobs:
259250
REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz")
260251
echo "React Native tgs is $REACT_NATIVE_PKG"
261252
262-
HERMES_PATH=$(find /tmp/react-native-tmp -type f -name "*.tar.gz")
263-
echo "Hermes path is $HERMES_PATH"
264-
265253
# For stable branches, we want to use the stable branch of the template
266254
# In all the other cases, we want to use "main"
267255
BRANCH=${{ github.ref_name }}
@@ -278,7 +266,7 @@ jobs:
278266
export RCT_USE_LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
279267
# Disable prebuilds for now, as they are causing issues with E2E tests for 0.82-stable branch
280268
# export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
281-
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
269+
RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
282270
283271
xcodebuild \
284272
-scheme "RNTestProject" \

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,7 @@ internal object DependencyUtils {
231231
// explicitly in the version string? Remember to also update the logic for iOS
232232
val hermesVersionString =
233233
(hermesVersionProperties[INTERNAL_HERMES_VERSION_NAME] as? String).orEmpty()
234-
val hermesVersion =
235-
if (hermesVersionString.startsWith("0.0.0") || "-commitly-" in hermesVersionString) {
236-
"$hermesVersionString-SNAPSHOT"
237-
} else {
238-
hermesVersionString
239-
}
234+
val hermesVersion = hermesVersionString
240235

241236
val hermesV1Version =
242237
(hermesVersionProperties[INTERNAL_HERMES_V1_VERSION_NAME] as? String).orEmpty()

packages/react-native/sdks/hermes-engine/hermes-utils.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,15 @@ def nightly_tarball_url(version)
254254
artifact_name = "hermes-ios-debug.tar.gz"
255255
namespace = "com/facebook/hermes"
256256

257-
xml_url = "https://central.sonatype.com/repository/maven-snapshots/#{namespace}/#{artifact_coordinate}/#{version}-SNAPSHOT/maven-metadata.xml"
257+
xml_url = "https://central.sonatype.com/repository/maven-snapshots/#{namespace}/#{artifact_coordinate}/#{version}/maven-metadata.xml"
258258

259259
response = Net::HTTP.get_response(URI(xml_url))
260260
if response.is_a?(Net::HTTPSuccess)
261261
xml = REXML::Document.new(response.body)
262262
timestamp = xml.elements['metadata/versioning/snapshot/timestamp'].text
263263
build_number = xml.elements['metadata/versioning/snapshot/buildNumber'].text
264264
full_version = "#{version}-#{timestamp}-#{build_number}"
265-
final_url = "https://central.sonatype.com/repository/maven-snapshots/#{namespace}/#{artifact_coordinate}/#{version}-SNAPSHOT/#{artifact_coordinate}-#{full_version}-#{artifact_name}"
265+
final_url = "https://central.sonatype.com/repository/maven-snapshots/#{namespace}/#{artifact_coordinate}/#{version}/#{artifact_coordinate}-#{full_version}-#{artifact_name}"
266266

267267
return final_url
268268
else

private/helloworld/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@ android {
115115
dependencies {
116116
// The version of react-native is set by the React Native Gradle Plugin
117117
implementation("com.facebook.react:react-android")
118-
implementation("com.facebook.react:hermes-android")
118+
implementation("com.facebook.hermes:hermes-android")
119119
}

private/helloworld/android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ reactNativeArchitectures=arm64-v8a
1111
newArchEnabled=true
1212
hermesEnabled=true
1313
edgeToEdgeEnabled=false
14+
react.internal.useHermesNightly=true

0 commit comments

Comments
 (0)