diff --git a/scripts/e2e/init-project-e2e.js b/scripts/e2e/init-project-e2e.js index 30db3b9c33d2..d8869d1ce0f7 100644 --- a/scripts/e2e/init-project-e2e.js +++ b/scripts/e2e/init-project-e2e.js @@ -112,6 +112,10 @@ async function initNewProjectFromSource( // packages are updated in a lockstep, let's get the version of the first one const version = packages[Object.keys(packages)[0]].packageJson.version; + // npm >= 11 refuses to publish a prerelease version (e.g. 0.87.0-rc.0) + // without an explicit --tag, since it would otherwise become `latest`. + const publishTag = version.includes('-') ? ' --tag prerelease' : ''; + console.log('Publishing packages to local npm proxy\n'); for (const {path: packagePath, packageJson} of Object.values(packages)) { const desc = `${packageJson.name} (${path.relative( @@ -122,7 +126,7 @@ async function initNewProjectFromSource( `${desc} ${styleText('dim', '.').repeat(Math.max(0, 72 - desc.length))} `, ); execSync( - `npm publish --registry ${VERDACCIO_SERVER_URL} --access public`, + `npm publish --registry ${VERDACCIO_SERVER_URL} --access public${publishTag}`, { cwd: packagePath, stdio: verbose ? 'inherit' : [process.stderr], diff --git a/scripts/release-testing/test-release-local.js b/scripts/release-testing/test-release-local.js index 31a0733af47b..c5593709e93e 100644 --- a/scripts/release-testing/test-release-local.js +++ b/scripts/release-testing/test-release-local.js @@ -290,9 +290,11 @@ async function testRNTestProject( cd('RNTestProject'); - // need to do this here so that Android will be properly setup either way + // need to do this here so that Android will be properly setup either way. + // Use printf, not `echo -e`: on macOS /bin/sh's echo doesn't support -e, so + // it appends a literal "-e " onto the previous property and corrupts the file. exec( - `echo -e "\nreact.internal.mavenLocalRepo=${mavenLocalPath}" >> android/gradle.properties`, + `printf '\\nreact.internal.mavenLocalRepo=%s\\n' "${mavenLocalPath}" >> android/gradle.properties`, ); // Only build the simulator architecture. CI is however generating only that one.