mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: When dry-run in stable branch, the tag already exists. We are bypassing the tag-existence check when in a dry-run to have the CI pass ## Changelog [General] [Fixed] - Bypass tag version check when dry-run Pull Request resolved: https://github.com/facebook/react-native/pull/35470 Test Plan: CircleCI It worked for RC1 and RC2 Reviewed By: cortinico Differential Revision: D41529648 Pulled By: cipolleschi fbshipit-source-id: d4d7f5534f86c2cf10b05e0d4cab950e4902d8df
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6f11b10a88
commit
8b8f4f3efd
@@ -76,7 +76,7 @@ async function main() {
|
||||
);
|
||||
const token = argv.token;
|
||||
const releaseVersion = argv.toVersion;
|
||||
failIfTagExists(releaseVersion);
|
||||
failIfTagExists(releaseVersion, 'release');
|
||||
|
||||
const {pushed} = await inquirer.prompt({
|
||||
type: 'confirm',
|
||||
|
||||
@@ -50,7 +50,13 @@ const releaseVersion = argv.toVersion;
|
||||
const isLatest = argv.latest;
|
||||
const isDryRun = argv.dryRun;
|
||||
|
||||
failIfTagExists(releaseVersion);
|
||||
const buildType = isDryRun
|
||||
? 'dry-run'
|
||||
: isReleaseBranch(branch)
|
||||
? 'release'
|
||||
: 'nightly';
|
||||
|
||||
failIfTagExists(releaseVersion, buildType);
|
||||
|
||||
if (branch && !isReleaseBranch(branch) && !isDryRun) {
|
||||
console.error(`This needs to be on a release branch. On branch: ${branch}`);
|
||||
@@ -60,12 +66,6 @@ if (branch && !isReleaseBranch(branch) && !isDryRun) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const buildType = isDryRun
|
||||
? 'dry-run'
|
||||
: isReleaseBranch(branch)
|
||||
? 'release'
|
||||
: 'nightly';
|
||||
|
||||
const {version} = parseVersion(releaseVersion, buildType);
|
||||
if (version == null) {
|
||||
console.error(`Invalid version provided: ${releaseVersion}`);
|
||||
|
||||
@@ -115,7 +115,13 @@ function generateiOSArtifacts(
|
||||
return tarballOutputPath;
|
||||
}
|
||||
|
||||
function failIfTagExists(version) {
|
||||
function failIfTagExists(version, buildType) {
|
||||
// When dry-run in stable branch, the tag already exists.
|
||||
// We are bypassing the tag-existence check when in a dry-run to have the CI pass
|
||||
if (buildType === 'dry-run') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkIfTagExists(version)) {
|
||||
echo(`Tag v${version} already exists.`);
|
||||
echo('You may want to rollback the last commit');
|
||||
|
||||
Reference in New Issue
Block a user