Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LOCAL] Bypass tag check in dry run #35428

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/bump-oss-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
14 changes: 7 additions & 7 deletions scripts/prepare-package-for-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -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}`);
Expand Down
8 changes: 7 additions & 1 deletion scripts/release-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,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');
Expand Down