Commit dcf08b3 Riccardo
committed
1 parent 1f8c0c8 commit dcf08b3 Copy full SHA for dcf08b3
File tree 3 files changed +15
-9
lines changed
3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ async function main() {
76
76
) ;
77
77
const token = argv . token ;
78
78
const releaseVersion = argv . toVersion ;
79
- failIfTagExists ( releaseVersion ) ;
79
+ failIfTagExists ( releaseVersion , 'release' ) ;
80
80
81
81
const { pushed} = await inquirer . prompt ( {
82
82
type : 'confirm' ,
Original file line number Diff line number Diff line change @@ -50,7 +50,13 @@ const releaseVersion = argv.toVersion;
50
50
const isLatest = argv . latest ;
51
51
const isDryRun = argv . dryRun ;
52
52
53
- failIfTagExists ( releaseVersion ) ;
53
+ const buildType = isDryRun
54
+ ? 'dry-run'
55
+ : isReleaseBranch ( branch )
56
+ ? 'release'
57
+ : 'nightly' ;
58
+
59
+ failIfTagExists ( releaseVersion , buildType ) ;
54
60
55
61
if ( branch && ! isReleaseBranch ( branch ) && ! isDryRun ) {
56
62
console . error ( `This needs to be on a release branch. On branch: ${ branch } ` ) ;
@@ -60,12 +66,6 @@ if (branch && !isReleaseBranch(branch) && !isDryRun) {
60
66
exit ( 1 ) ;
61
67
}
62
68
63
- const buildType = isDryRun
64
- ? 'dry-run'
65
- : isReleaseBranch ( branch )
66
- ? 'release'
67
- : 'nightly' ;
68
-
69
69
const { version} = parseVersion ( releaseVersion , buildType ) ;
70
70
if ( version == null ) {
71
71
console . error ( `Invalid version provided: ${ releaseVersion } ` ) ;
Original file line number Diff line number Diff line change @@ -117,7 +117,13 @@ function generateiOSArtifacts(
117
117
return tarballOutputPath ;
118
118
}
119
119
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
+
121
127
if ( checkIfTagExists ( version ) ) {
122
128
echo ( `Tag v${ version } already exists.` ) ;
123
129
echo ( 'You may want to rollback the last commit' ) ;
You can’t perform that action at this time.
0 commit comments