File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff 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' ,
Original file line number Diff line number Diff line change @@ -50,7 +50,13 @@ const releaseVersion = argv.toVersion;
5050const isLatest = argv . latest ;
5151const 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
5561if ( 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-
6969const { version} = parseVersion ( releaseVersion , buildType ) ;
7070if ( version == null ) {
7171 console . error ( `Invalid version provided: ${ releaseVersion } ` ) ;
Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments