File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,15 @@ def call(Map config) {
8383 env[' NEW_VERSION' ] = Version (params. UPDATE_VERSION , versionParts)
8484 }
8585
86+ // Set GIT_CURRENT_VERSION to a tag name without leading 'v' with fallback to GIT_LAST_VERSION
87+ if (env[' GIT_BRANCH_OR_TAG' ] == ' tag' && env[' GIT_LOCAL_BRANCH' ] =~ / ^v(\d +\. )+\d +$/ ) {
88+ env[' GIT_CURRENT_VERSION' ] = env[' GIT_LOCAL_BRANCH' ]. replaceFirst(~/ ^v/ ,' ' )
89+ } else {
90+ env[' GIT_CURRENT_VERSION' ] = env[' GIT_LAST_VERSION' ]
91+ }
92+
8693 env[' GIT_NEW_TAG' ] = " v${ env['NEW_VERSION']} "
87- env[' TARGET_VERSION' ] = env[' GIT_BRANCH_OR_TAG' ] == ' branch' ? env[' NEW_VERSION' ] : env[' GIT_LAST_VERSION ' ]
94+ env[' TARGET_VERSION' ] = env[' GIT_BRANCH_OR_TAG' ] == ' branch' ? env[' NEW_VERSION' ] : env[' GIT_CURRENT_VERSION ' ]
8895
8996 // We change build display name by default
9097 if (config. get(' changeBuildName' , true )) {
You can’t perform that action at this time.
0 commit comments