Skip to content

Commit ca18fac

Browse files
author
Riccardo Cipolleschi
committed
chore: bypass tag check in dry-run
1 parent 67c373f commit ca18fac

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

scripts/bump-oss-version.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,13 @@ function generateiOSArtifacts(
139139
return tarballOutputPath;
140140
}
141141

142-
function failIfTagExists(version) {
142+
function failIfTagExists(version, buildType) {
143+
// When dry-run in stable branch, the tag already exists.
144+
// We are bypassing the tag-existence check when in a dry-run to have the CI pass
145+
if (buildType === 'dry-run') {
146+
return;
147+
}
148+
143149
if (checkIfTagExists(version)) {
144150
echo(`Tag v${version} already exists.`);
145151
echo('You may want to rollback the last commit');

0 commit comments

Comments
 (0)