Skip to content

Commit dcf08b3

Browse files
author
Riccardo
committed
Bypass tag check in dry run
1 parent 1f8c0c8 commit dcf08b3

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
@@ -117,7 +117,13 @@ function generateiOSArtifacts(
117117
return tarballOutputPath;
118118
}
119119

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

0 commit comments

Comments
 (0)