Skip to content

Commit be317a7

Browse files
authored
Ignore publish errors in get-and-update-nightlies (#1962)
#### Please select one of the following - [ ] I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍 - [ ] I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍 - [ ] I am making a fix / change for the macOS implementation of react-native - [x] I am making a change required for Microsoft usage of react-native ## Summary: Right now, our nightly publishing pipelines are broken, which prevents our scripts from running component detection. This was caused by 52104c6, which we inherited from RNCore, and their publishing process is slightly different. This reverts to the previous, more lenient way of checking things. ## Changelog: [INTERNAL] [FIXED] - Fix build scripts ## Test Plan: The spot we changed is where the error we were logging came from, so this reversion should work.
2 parents 2fe53e8 + 5639636 commit be317a7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/monorepo/get-and-update-nightlies.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ function updateDependencies(
127127

128128
/**
129129
* Publish the passed set of packages to npm with the `nightly` tag.
130-
* In case a package fails to be published, it throws an error, stopping the nightly publishing completely
130+
* [macOS] In case a package fails to be published, the upstream version of this script throws an error.
131+
* However, since this fork defers publishing to a separate ADO step, we just log the error and move on.
131132
*/
132133
function publishPackages(packages /*: PackageMap */) {
133134
for (const [packageName, packageMetadata] of Object.entries(packages)) {
@@ -140,9 +141,12 @@ function publishPackages(packages /*: PackageMap */) {
140141
});
141142

142143
if (result.code !== 0) {
143-
throw new Error(
144+
// [macOS Our publish-npm.js script doesn't actually publish, so we shouldn't throw an error on failure
145+
console.log(
144146
`\u274c Failed to publish version ${nightlyVersion} of ${packageName}. npm publish exited with code ${result.code}:`,
145147
);
148+
console.error(result.stderr);
149+
// macOS]
146150
}
147151

148152
console.log(`\u2705 Successfully published new version of ${packageName}`);

0 commit comments

Comments
 (0)