Skip to content

Commit 8e80dc8

Browse files
hramosfacebook-github-bot
authored andcommitted
Circle CI: Build Hermes apple runtime artifacts on CI (#33876)
Summary: Pull Request resolved: #33876 WIP. Published so we can export and test on CI. These two jobs can likely be merged onto the existing build_hermesc_macos job. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D36538847 fbshipit-source-id: e52c39ccfe652e70c54fd4892513c0060c3f021d
1 parent 6e18dda commit 8e80dc8

File tree

1 file changed

+42
-25
lines changed

1 file changed

+42
-25
lines changed

.circleci/config.yml

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ references:
4141
gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
4242
gradle_cache_key: &gradle_cache_key v1-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "ReactAndroid/gradle.properties" }}
4343
hermes_cache_key: &hermes_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
44-
hermes_sdk_cache_key: &hermes_sdk_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermesversion" }}
44+
hermes_sdk_cache_key: &hermes_sdk_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermes-cache-key-file" }}
4545
hermes_windows_cache_key: &hermes_windows_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
4646
pods_cache_key: &pods_cache_key v6-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
4747
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
@@ -278,9 +278,9 @@ commands:
278278
- run:
279279
name: Setup Hermes cache
280280
command: |
281-
HERMES_VERSION_FILE="sdks/.hermesversion"
282-
if [ ! -f "$HERMES_VERSION_FILE" ]; then
283-
git ls-remote https://github.com/facebook/hermes main | cut -f 1 > $HERMES_VERSION_FILE
281+
HERMES_CACHE_KEY_FILE="sdks/.hermes-cache-key-file"
282+
if [ ! -f "$HERMES_CACHE_KEY_FILE" ]; then
283+
git ls-remote https://github.com/facebook/hermes main | cut -f 1 > $HERMES_CACHE_KEY_FILE
284284
fi
285285
- restore_cache:
286286
keys:
@@ -939,7 +939,7 @@ jobs:
939939
paths:
940940
- linux64-bin
941941

942-
build_hermesc_macos:
942+
build_hermes_macos:
943943
executor: reactnativeios
944944
environment:
945945
- HERMES_WS_DIR: *hermes_workspace_root
@@ -952,28 +952,46 @@ jobs:
952952
name: Set up workspace
953953
command: |
954954
mkdir -p /tmp/hermes/osx-bin
955-
cp ~/react-native/sdks/hermes-engine/utils/* "$HERMES_WS_DIR/hermes/utils/."
955+
mkdir -p ~/react-native/sdks/hermes
956+
cp -r $HERMES_WS_DIR/hermes/* ~/react-native/sdks/hermes/.
956957
- run:
957958
name: Install dependencies
958959
command: |
959960
brew install cmake
960961
- run:
961-
name: Build HermesC for macOS
962+
name: Build the Hermes iOS frameworks
962963
command: |
963-
if [ -f /tmp/hermes/osx-bin/hermesc ]; then
964-
echo 'Skipping; Clean "/tmp/hermes/osx-bin" to rebuild.'
965-
else
966-
cd "$HERMES_WS_DIR/hermes"
967-
./utils/build-mac-framework.sh
968-
cp build_macosx/bin/hermesc /tmp/hermes/osx-bin/.
969-
fi
964+
cd ~/react-native/sdks/hermes
965+
./utils/build-ios-framework.sh
966+
- run:
967+
name: Build the Hermes Mac frameworks
968+
command: |
969+
cd ~/react-native/sdks/hermes
970+
./utils/build-mac-framework.sh
971+
cp build_macosx/bin/hermesc /tmp/hermes/osx-bin/.
972+
- run:
973+
name: Package the Hermes Apple frameworks
974+
command: |
975+
cd ~/react-native/sdks/hermes
976+
. ./utils/build-apple-framework.sh
977+
978+
mkdir -p /tmp/cocoapods-package-root/destroot
979+
mkdir -p /tmp/hermes/output
980+
cp -R ./destroot /tmp/cocoapods-package-root
981+
cp hermes-engine.podspec LICENSE /tmp/cocoapods-package-root
982+
983+
tar -C /tmp/cocoapods-package-root/ -czvf /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz .
970984
- save_cache:
971985
key: *hermes_cache_key
972986
paths:
973-
- /tmp/hermes/osx-bin/
974-
- /tmp/hermes/hermes/destroot/
975-
- /tmp/hermes/hermes/build_host_hermesc/
976-
- /tmp/hermes/hermes/build_macosx/
987+
- ~/react-native/hermes/build_host_hermesc
988+
- ~/react-native/hermes/build_iphoneos
989+
- ~/react-native/hermes/build_catalyst
990+
- ~/react-native/hermes/build_iphonesimulator
991+
- ~/react-native/hermes/build_macosx
992+
- ~/react-native/hermes/destroot
993+
- store_artifacts:
994+
path: /tmp/hermes/output/
977995
- store_artifacts:
978996
path: /tmp/hermes/osx-bin/
979997
- persist_to_workspace:
@@ -1225,7 +1243,7 @@ workflows:
12251243
- build_hermesc_linux:
12261244
requires:
12271245
- prepare_hermes_workspace
1228-
- build_hermesc_macos:
1246+
- build_hermes_macos:
12291247
requires:
12301248
- prepare_hermes_workspace
12311249
- build_hermesc_windows:
@@ -1236,7 +1254,7 @@ workflows:
12361254
publish_npm_args: --dry-run
12371255
requires:
12381256
- build_hermesc_linux
1239-
- build_hermesc_macos
1257+
- build_hermes_macos
12401258
- build_hermesc_windows
12411259
- test_js:
12421260
run_disabled_tests: false
@@ -1283,7 +1301,7 @@ workflows:
12831301
filters: *only_release_tags
12841302
requires:
12851303
- prepare_hermes_workspace
1286-
- build_hermesc_macos:
1304+
- build_hermes_macos:
12871305
filters: *only_release_tags
12881306
requires:
12891307
- prepare_hermes_workspace
@@ -1299,7 +1317,7 @@ workflows:
12991317
filters: *only_release_tags
13001318
requires:
13011319
- build_hermesc_linux
1302-
- build_hermesc_macos
1320+
- build_hermes_macos
13031321
- build_hermesc_windows
13041322

13051323
analysis:
@@ -1330,16 +1348,15 @@ workflows:
13301348
- build_hermesc_linux:
13311349
requires:
13321350
- prepare_hermes_workspace
1333-
- build_hermesc_macos:
1351+
- build_hermes_macos:
13341352
requires:
13351353
- prepare_hermes_workspace
13361354
- build_hermesc_windows:
13371355
requires:
13381356
- prepare_hermes_workspace
1339-
13401357
- build_npm_package:
13411358
publish_npm_args: --nightly
13421359
requires:
13431360
- build_hermesc_linux
1344-
- build_hermesc_macos
1361+
- build_hermes_macos
13451362
- build_hermesc_windows

0 commit comments

Comments
 (0)