mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
0a3ca80af4
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/34694 TL;DR Relax the assumption of having git to build the RN NPM package. We do have two CI Systems: CircleCI for OpenSource and Sandcastle for Internal. It's crucial that the two CIs are aligned. We currently don't have a way to test the new app template on Sandcastle for Android & iOS. This results in scenarios where internal Diffs gets landed and break the public CI externally. This is preparation work to then be able to build the RN NPM package in Sandcastle (which will be done in a follow-up diff). With this we also introduce the restoring of all the changed files after the publishing script is done. ## Changelog [Internal] [Added] - Made it possible to create publishing NPM packages in Sandcastle. Reviewed By: cortinico, cipolleschi Differential Revision: D39467471 fbshipit-source-id: b0de88a768b8a2fb798dd684fa8f97f4d0acb751
37 lines
759 B
JavaScript
37 lines
759 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 VERSION_REGEX = /^v?((\d+)\.(\d+)\.(\d+)(?:-(.+))?)$/;
|
|
|
|
function parseVersion(versionStr) {
|
|
const match = versionStr.match(VERSION_REGEX);
|
|
if (!match) {
|
|
throw new Error(
|
|
`You must pass a correctly formatted version; couldn't parse ${versionStr}`,
|
|
);
|
|
}
|
|
const [, version, major, minor, patch, prerelease] = match;
|
|
return {
|
|
version,
|
|
major,
|
|
minor,
|
|
patch,
|
|
prerelease,
|
|
};
|
|
}
|
|
|
|
function isReleaseBranch(branch) {
|
|
return branch.endsWith('-stable');
|
|
}
|
|
|
|
module.exports = {
|
|
parseVersion,
|
|
isReleaseBranch,
|
|
};
|