Skip to content

Commit

Permalink
Circle CI: Build Hermes apple runtime artifacts on CI (#33876)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hramos authored and facebook-github-bot committed May 23, 2022
1 parent 6e18dda commit 8e80dc8
Showing 1 changed file with 42 additions and 25 deletions.
67 changes: 42 additions & 25 deletions .circleci/config.yml
Expand Up @@ -41,7 +41,7 @@ references:
gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
gradle_cache_key: &gradle_cache_key v1-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "ReactAndroid/gradle.properties" }}
hermes_cache_key: &hermes_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_sdk_cache_key: &hermes_sdk_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermesversion" }}
hermes_sdk_cache_key: &hermes_sdk_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "sdks/.hermes-cache-key-file" }}
hermes_windows_cache_key: &hermes_windows_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
pods_cache_key: &pods_cache_key v6-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
Expand Down Expand Up @@ -278,9 +278,9 @@ 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:
Expand Down Expand Up @@ -939,7 +939,7 @@ jobs:
paths:
- linux64-bin

build_hermesc_macos:
build_hermes_macos:
executor: reactnativeios
environment:
- HERMES_WS_DIR: *hermes_workspace_root
Expand All @@ -952,28 +952,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: *hermes_cache_key
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:
Expand Down Expand Up @@ -1225,7 +1243,7 @@ workflows:
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermesc_macos:
- build_hermes_macos:
requires:
- prepare_hermes_workspace
- build_hermesc_windows:
Expand All @@ -1236,7 +1254,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
Expand Down Expand Up @@ -1283,7 +1301,7 @@ workflows:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermesc_macos:
- build_hermes_macos:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
Expand All @@ -1299,7 +1317,7 @@ workflows:
filters: *only_release_tags
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermes_macos
- build_hermesc_windows

analysis:
Expand Down Expand Up @@ -1330,16 +1348,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

0 comments on commit 8e80dc8

Please sign in to comment.