mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Do not use hermesNightly on the release branch (#55890)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55890 Changelog: [Internal] This was done manually on `0.84-stable` and `0.85-stable`. Discovered due to the failure when pushing the new `0.85-stable` branch: https://github.com/facebook/react-native/actions/runs/22592250332/job/65471130298. Reviewed By: cortinico Differential Revision: D95051387 fbshipit-source-id: 2a9f0cfeef37ec1903d42259bec3518af721410c
This commit is contained in:
1 parent
1d47693230
commit
50ae4c8838
2 files changed
+35
No files matched your search
@@ -9,6 +9,9 @@
|
||||
*/
|
||||
|
||||
const {setVersion} = require('../releases/set-version');
|
||||
const {
|
||||
setStableHermesForReleaseBranch,
|
||||
} = require('../releases/utils/hermes-utils');
|
||||
const {getBranchName} = require('../releases/utils/scm-utils');
|
||||
const {
|
||||
writeReleaseAssetUrlsToDotSlashFiles,
|
||||
@@ -52,6 +55,9 @@ async function main() {
|
||||
console.info('Setting version for monorepo packages and react-native');
|
||||
await setVersion(version, false); // version, skip-react-native
|
||||
|
||||
console.info('Set stable Hermes for release branch');
|
||||
await setStableHermesForReleaseBranch();
|
||||
|
||||
console.info('Writing release asset URLs to DotSlash files');
|
||||
await writeReleaseAssetUrlsToDotSlashFiles(version);
|
||||
|
||||
|
||||
@@ -25,6 +25,13 @@ const MAVEN_VERSIONS_FILE_PATH = path.join(
|
||||
'version.properties',
|
||||
);
|
||||
|
||||
const GRADLE_PROPERTIES_PATH = path.join(
|
||||
REACT_NATIVE_PACKAGE_DIR,
|
||||
'..',
|
||||
'..',
|
||||
'gradle.properties',
|
||||
);
|
||||
|
||||
async function getLatestHermesNightlyVersion() /*: Promise<{
|
||||
compilerVersion: string,
|
||||
compilerV1Version: string,
|
||||
@@ -51,6 +58,27 @@ async function getLatestHermesNightlyVersion() /*: Promise<{
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates gradle.properties to use stable Hermes instead of nightly.
|
||||
* This is needed because main uses nightly Hermes, but release branches
|
||||
* should use stable Hermes from Maven Central.
|
||||
*/
|
||||
async function setStableHermesForReleaseBranch() {
|
||||
let content = await fs.readFile(GRADLE_PROPERTIES_PATH, 'utf8');
|
||||
|
||||
content = content.replace(
|
||||
'react.internal.useHermesStable=false',
|
||||
'react.internal.useHermesStable=true',
|
||||
);
|
||||
content = content.replace(
|
||||
'react.internal.useHermesNightly=true',
|
||||
'react.internal.useHermesNightly=false',
|
||||
);
|
||||
|
||||
await fs.writeFile(GRADLE_PROPERTIES_PATH, content, 'utf8');
|
||||
console.info('Switched gradle.properties to use stable Hermes');
|
||||
}
|
||||
|
||||
async function updateHermesCompilerVersionInDependencies(
|
||||
hermesVersion /*: string */,
|
||||
) /*: Promise<void> */ {
|
||||
@@ -95,6 +123,7 @@ async function updateHermesVersionsToNightly() {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setStableHermesForReleaseBranch,
|
||||
updateHermesVersionsToNightly,
|
||||
updateHermesCompilerVersionInDependencies,
|
||||
updateHermesRuntimeDependenciesVersions,
|
||||
|
||||
Reference in new issue
Block a user