Fix wrong command for publishing of external-artifacts (#46417)

Summary:
This is a pick on main of a fix necessary to release 0.76.x

## Changelog:

[INTERNAL] - Fix wrong command for publishing of external-artifacts

Pull Request resolved: https://github.com/facebook/react-native/pull/46417

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D62440193

Pulled By: cortinico

fbshipit-source-id: 57ea0736c1b6e3e60b048a46770356901de74024
This commit is contained in:
Nicola Corti 2024-09-10 07:11:42 -07:00 committed by Facebook GitHub Bot
parent d3d48cb357
commit 773a02ad5d
2 changed files with 8 additions and 7 deletions

View File

@ -116,14 +116,15 @@ async function publishNpm(buildType /*: BuildType */) /*: Promise<void> */ {
return;
}
// We first publish on Maven Central the external artifacts
// produced by iOS
publishExternalArtifactsToMaven(version, buildType);
// We the publish on Maven Central all the Android artifacts.
// NPM publishing is done just after.
// We first publish on Maven Central all the Android artifacts.
// Those were built by the `build-android` CI job.
publishAndroidArtifactsToMaven(version, buildType);
// And we then publish on Maven Central the external artifacts
// produced by iOS
// NPM publishing is done just after.
publishExternalArtifactsToMaven(version, buildType);
const packagePath = path.join(REPO_ROOT, 'packages', 'react-native');
const result = publishPackage(packagePath, {
tags: [tag],

View File

@ -96,7 +96,7 @@ function publishExternalArtifactsToMaven(
// This can't be done earlier in build_android because this artifact are partially built by the iOS jobs.
if (
exec(
'./gradlew :packages:react-native:ReactAndroid:external-artifacts:publishToSonatype :packages:react-native:ReactAndroid:external-artifacts:closeAndReleaseSonatypeStagingRepository',
'./gradlew :packages:react-native:ReactAndroid:external-artifacts:publishToSonatype closeAndReleaseSonatypeStagingRepository',
).code
) {
echo(