Files
react-native/.github/workflow-scripts/verifyReleaseOnNpm.js
T
Riccardo Cipolleschi 70c3b2dcff Fix release scripts to check npm packages (#49788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49788

Release of 0.78 was successful but it failed to verify the package of NPM because of some error in the JS files.

Preparing for 0.79, I discovered some other issues in the NPM checking scripts.

This change should fix them.

## Changelog:
[Internal] - Fix publishing scripts

Reviewed By: fabriziocucci

Differential Revision: D70489717

fbshipit-source-id: 02a37d9a86fe108c7f7d2d634b8c0727dabb153d
2025-03-03 06:54:54 -08:00

28 lines
928 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const {run, sleep, log} = require('./utils.js');
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
const REACT_NATIVE_NPM_PKG = 'react-native';
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
/**
* Will verify that @latest, @next and the @<version> have been published.
*
* NOTE: This will infinitely query each step until successful, make sure the
* calling job has a timeout.
*/
module.exports.verifyReleaseOnNpm = async (
version,
latest = false,
retries = MAX_RETRIES,
) => {
const tag = version.includes('-rc.') ? 'next' : latest ? 'latest' : null;
await verifyPublishedPackage(REACT_NATIVE_NPM_PKG, version, tag, retries);
};