Skip to content

Commit 846e460

Browse files
author
Riccardo
committed
Bypass tag check in dry run
1 parent f75b92a commit 846e460

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

scripts/bump-oss-version.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function main() {
7676
);
7777
const token = argv.token;
7878
const releaseVersion = argv.toVersion;
79-
failIfTagExists(releaseVersion);
79+
failIfTagExists(releaseVersion, 'release');
8080

8181
const {pushed} = await inquirer.prompt({
8282
type: 'confirm',

scripts/prepare-package-for-release.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ const releaseVersion = argv.toVersion;
5050
const isLatest = argv.latest;
5151
const isDryRun = argv.dryRun;
5252

53-
failIfTagExists(releaseVersion);
53+
const buildType = isDryRun
54+
? 'dry-run'
55+
: isReleaseBranch(branch)
56+
? 'release'
57+
: 'nightly';
58+
59+
failIfTagExists(releaseVersion, buildType);
5460

5561
if (branch && !isReleaseBranch(branch) && !isDryRun) {
5662
console.error(`This needs to be on a release branch. On branch: ${branch}`);
@@ -60,12 +66,6 @@ if (branch && !isReleaseBranch(branch) && !isDryRun) {
6066
exit(1);
6167
}
6268

63-
const buildType = isDryRun
64-
? 'dry-run'
65-
: isReleaseBranch(branch)
66-
? 'release'
67-
: 'nightly';
68-
6969
const {version} = parseVersion(releaseVersion, buildType);
7070
if (version == null) {
7171
console.error(`Invalid version provided: ${releaseVersion}`);

scripts/release-utils.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ function generateiOSArtifacts(
115115
return tarballOutputPath;
116116
}
117117

118-
function failIfTagExists(version) {
118+
function failIfTagExists(version, buildType) {
119+
// When dry-run in stable branch, the tag already exists.
120+
// We are bypassing the tag-existence check when in a dry-run to have the CI pass
121+
if (buildType === 'dry-run') {
122+
return;
123+
}
124+
119125
if (checkIfTagExists(version)) {
120126
echo(`Tag v${version} already exists.`);
121127
echo('You may want to rollback the last commit');

0 commit comments

Comments
 (0)