From 93c3effc7284cfd5e64a9280e1a56ee7e86127d1 Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Mon, 3 Oct 2022 08:16:16 -0700 Subject: [PATCH] Fix issues for nightly build (#34846) Summary: There are two issues from nightly builds. #### 1. `VERSION_NAME=1000.0.0-main` in _ReactAndroid/gradle.properties_ the solution is to remove unused _ReactAndroid/gradle.properties_ git revert when publishing package. #### 2. `pod install` error from downloading hermes, e.g. the url is unavailable. `https://github.com/facebook/react-native/releases/download/v0.0.0-20221002-2027-2319f75c8/hermes-runtime-darwin-debug-v0.0.0-20221002-2027-2319f75c8.tar.gz` fix _hermes-engine.podspec_ to support nightly build and build hermes from main branch. ## Changelog [General] [Fixed] - Fix nightly build issues Pull Request resolved: https://github.com/facebook/react-native/pull/34846 Test Plan: 1. i cannot fully test publish-npm.js workflow and it stops at `npm publish`. i can just check at this moment, the _ReactAndroid/gradle.properties_ is right. 2. create a `npx react-native init` project and `yarn add react-native@nightly`. patch `node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec` and try `pod install` Reviewed By: cipolleschi Differential Revision: D40021649 Pulled By: cortinico fbshipit-source-id: c9e2701e524f4b16eab6f2c72b5cfa34883082c3 --- scripts/publish-npm.js | 4 ---- sdks/hermes-engine/hermes-engine.podspec | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/publish-npm.js b/scripts/publish-npm.js index e80ec70be0fa7e..036db010fdbbbc 100755 --- a/scripts/publish-npm.js +++ b/scripts/publish-npm.js @@ -37,7 +37,6 @@ const { exitIfNotOnGit, getCurrentCommit, isTaggedLatest, - revertFiles, saveFiles, } = require('./scm-utils'); const fs = require('fs'); @@ -210,9 +209,6 @@ if (exec('./gradlew :ReactAndroid:hermes-engine:installArchives').code) { exit(1); } -// undo uncommenting javadoc setting -revertFiles(['ReactAndroid/gradle.properties'], tmpPublishingFolder); - echo('Generated artifacts for Maven'); let artifacts = [ diff --git a/sdks/hermes-engine/hermes-engine.podspec b/sdks/hermes-engine/hermes-engine.podspec index a141848e7a0d0e..d06bf545d0e3eb 100644 --- a/sdks/hermes-engine/hermes-engine.podspec +++ b/sdks/hermes-engine/hermes-engine.podspec @@ -28,7 +28,7 @@ git = "https://github.com/facebook/hermes.git" if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH') Pod::UI.puts '[Hermes] Using pre-built Hermes binaries from local path.' if Object.const_defined?("Pod::UI") source[:http] = "file://#{ENV['HERMES_ENGINE_TARBALL_PATH']}" -elsif version == '1000.0.0' +elsif version == '1000.0.0' || version.start_with?('0.0.0-') Pod::UI.puts '[Hermes] Installing hermes-engine may take a while, building Hermes from source...'.yellow if Object.const_defined?("Pod::UI") source[:git] = git source[:commit] = `git ls-remote https://github.com/facebook/hermes main | cut -f 1`.strip