Skip to content

Commit

Permalink
fix: make sure we can build hermes when working against stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccardo Cipolleschi committed Jul 19, 2022
1 parent a19578d commit 4338826
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
13 changes: 11 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,17 @@ jobs:
name: Download Hermes tarball
command: |
node scripts/hermes/prepare-hermes-for-build
cp sdks/download/* $HERMES_WS_DIR/download/.
cp -r sdks/hermes/* $HERMES_WS_DIR/hermes/.
# If Hermes is not built from source, we don't have these folders.
DOWNLOAD_FOLDER=sdks/download/
if [[ -d $DOWNLOAD_FOLDER ]]; then
cp $DOWNLOAD_FOLDER* $HERMES_WS_DIR/download/.
fi
HERMES_FOLDER=sdks/hermes/
if [[ -d $HERMES_FOLDER ]]; then
cp -r $HERMES_FOLDER* $HERMES_WS_DIR/hermes/.
fi
- save_cache:
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
paths:
Expand Down
15 changes: 12 additions & 3 deletions scripts/hermes/hermes-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,19 @@ function isOnAReleaseTag() {

function shouldBuildHermesFromSource() {
const hermesTag = readHermesTag();

const onReleaseBranch = isOnAReleaseBranch();
const onReleaseTag = isOnAReleaseTag();
const hermesTagIsDefault = hermesTag === DEFAULT_HERMES_TAG;

// Logging for CI Debugging
console.log(`[Hermes] On release branch? ${onReleaseBranch ? "Yes" : "No"}`)
console.log(`[Hermes] On release tag? ${onReleaseTag ? "Yes" : "No"}`)
console.log(`[Hermes] Hermes Tag is Default? ${hermesTagIsDefault ? "Yes" : "No"}`)
return (
isOnAReleaseBranch() ||
isOnAReleaseTag() ||
hermesTag === DEFAULT_HERMES_TAG
onReleaseBranch ||
onReleaseTag ||
hermesTagIsDefault
);
}

Expand Down
1 change: 1 addition & 0 deletions scripts/hermes/prepare-hermes-for-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const {

async function main() {
if (!shouldBuildHermesFromSource()) {
console.log('[Hermes] Not building from Source')
copyPodSpec();
return;
}
Expand Down

0 comments on commit 4338826

Please sign in to comment.