Circle CI: Build Hermes apple runtime artifacts on CI (#33876)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Héctor Ramos
2022-05-30 15:06:54 +01:00
committed by Nicola Corti
parent 2a6832a7e3
commit 605c90ed36
+43 -26
View File
@@ -254,16 +254,16 @@ commands:
- run:
name: Setup Hermes cache
command: |
HERMES_VERSION_FILE="sdks/.hermesversion"
if [ ! -f "$HERMES_VERSION_FILE" ]; then
git ls-remote https://github.com/facebook/hermes main | cut -f 1 > $HERMES_VERSION_FILE
HERMES_CACHE_KEY_FILE="sdks/.hermes-cache-key-file"
if [ ! -f "$HERMES_CACHE_KEY_FILE" ]; then
git ls-remote https://github.com/facebook/hermes main | cut -f 1 > $HERMES_CACHE_KEY_FILE
fi
- restore_cache:
keys:
- v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermesversion" }}
- v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermes-cache-key-file" }}
- steps: << parameters.steps >>
- save_cache:
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermesversion" }}
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermes-cache-key-file" }}
paths:
- sdks/hermesc
- sdks/hermes
@@ -995,7 +995,7 @@ jobs:
paths:
- linux64-bin
build_hermesc_macos:
build_hermes_macos:
executor: reactnativeios
environment:
- HERMES_WS_DIR: *hermes_workspace_root
@@ -1008,28 +1008,46 @@ jobs:
name: Set up workspace
command: |
mkdir -p /tmp/hermes/osx-bin
cp ~/react-native/sdks/hermes-engine/utils/* "$HERMES_WS_DIR/hermes/utils/."
mkdir -p ~/react-native/sdks/hermes
cp -r $HERMES_WS_DIR/hermes/* ~/react-native/sdks/hermes/.
- run:
name: Install dependencies
command: |
brew install cmake
- run:
name: Build HermesC for macOS
name: Build the Hermes iOS frameworks
command: |
if [ -f /tmp/hermes/osx-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/osx-bin" to rebuild.'
else
cd "$HERMES_WS_DIR/hermes"
./utils/build-mac-framework.sh
cp build_macosx/bin/hermesc /tmp/hermes/osx-bin/.
fi
cd ~/react-native/sdks/hermes
./utils/build-ios-framework.sh
- run:
name: Build the Hermes Mac frameworks
command: |
cd ~/react-native/sdks/hermes
./utils/build-mac-framework.sh
cp build_macosx/bin/hermesc /tmp/hermes/osx-bin/.
- run:
name: Package the Hermes Apple frameworks
command: |
cd ~/react-native/sdks/hermes
. ./utils/build-apple-framework.sh
mkdir -p /tmp/cocoapods-package-root/destroot
mkdir -p /tmp/hermes/output
cp -R ./destroot /tmp/cocoapods-package-root
cp hermes-engine.podspec LICENSE /tmp/cocoapods-package-root
tar -C /tmp/cocoapods-package-root/ -czvf /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz .
- save_cache:
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
paths:
- /tmp/hermes/osx-bin/
- /tmp/hermes/hermes/destroot/
- /tmp/hermes/hermes/build_host_hermesc/
- /tmp/hermes/hermes/build_macosx/
- ~/react-native/hermes/build_host_hermesc
- ~/react-native/hermes/build_iphoneos
- ~/react-native/hermes/build_catalyst
- ~/react-native/hermes/build_iphonesimulator
- ~/react-native/hermes/build_macosx
- ~/react-native/hermes/destroot
- store_artifacts:
path: /tmp/hermes/output/
- store_artifacts:
path: /tmp/hermes/osx-bin/
- persist_to_workspace:
@@ -1281,7 +1299,7 @@ workflows:
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermesc_macos:
- build_hermes_macos:
requires:
- prepare_hermes_workspace
- build_hermesc_windows:
@@ -1292,7 +1310,7 @@ workflows:
publish_npm_args: --dry-run
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermes_macos
- build_hermesc_windows
- test_js:
run_disabled_tests: false
@@ -1346,7 +1364,7 @@ workflows:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermesc_macos:
- build_hermes_macos:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
@@ -1362,7 +1380,7 @@ workflows:
filters: *only_release_tags
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermes_macos
- build_hermesc_windows
analysis:
@@ -1396,16 +1414,15 @@ workflows:
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermesc_macos:
- build_hermes_macos:
requires:
- prepare_hermes_workspace
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- build_npm_package:
publish_npm_args: --nightly
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermes_macos
- build_hermesc_windows