Skip to content

Commit 319631f

Browse files
Riccardo Cipolleschifacebook-github-bot
Riccardo Cipolleschi
authored andcommitted
fix: update CircleCI config to use the RN version in tarball caching (#35471)
Summary: This PR updates the Cache strategy for the tarballs to include the React Native version we are building. In this way, when we publish a new Release/RC we are sure that we are going to rebuild a nmew tarball. This should fix caching problems like: - we have misconfigured the build script for the Hermes tarball, we then fix it, but we distribute the wrong cached artifacts - the cached artifact has the wrong version ## Changelog [Internal] - Fixed Hermes Tarball Cache Logic Pull Request resolved: #35471 Test Plan: 1. CircleCI The real way to check this is in the next RC cycle or in the next nightly. Reviewed By: cortinico Differential Revision: D41530651 Pulled By: cipolleschi fbshipit-source-id: 45e8fd3b62c8e108d393d9463ff6762dfc6d3ec8
1 parent 67d0264 commit 319631f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.circleci/config.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ references:
5555
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}
5656
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}
5757
hermes_windows_cache_key: &hermes_windows_cache_key v3-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
58-
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v3-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}
59-
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v2-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}
58+
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v3-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version"}}
59+
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v2-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version"}}
6060
pods_cache_key: &pods_cache_key v8-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
6161
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
6262
yarn_cache_key: &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
@@ -272,6 +272,12 @@ commands:
272272
type: string
273273
default: *hermes_tarball_artifacts_dir
274274
steps:
275+
- run:
276+
name: Get React Native version
277+
command: |
278+
VERSION=$( grep '"version"' package.json | cut -d '"' -f 4 | head -1)
279+
# Save the react native version we are building in a file so we can use that file as part of the cache key.
280+
echo "$VERSION" > /tmp/react-native-version
275281
- when:
276282
condition:
277283
equal: [ << parameters.flavor >>, "Debug"]
@@ -1194,9 +1200,6 @@ jobs:
11941200
command: |
11951201
cd ./sdks/hermes || exit 1
11961202
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-mac-framework.sh
1197-
- with_hermesc_span:
1198-
flavor: << parameters.flavor >>
1199-
steps:
12001203
- run:
12011204
name: Build the Hermes iOS frameworks
12021205
command: |

0 commit comments

Comments
 (0)