diff --git a/Jenkinsfile b/Jenkinsfile index 63ea89f..029fa39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,17 +98,23 @@ ] tasks = [ run: { - def currentVersion = [ name: android.getVersion('versionName') as String, code: android.getVersion('versionCode') as Integer ] + def currentVersion = androidVersion() echo("currentVersion = ${currentVersion.toString()}") lazyGitPass('bot-ci-dgm', { // Fork a release branch as requested echo("Git logs since last tag:\n" + gitLog()) + def nextVersion = [ name: currentVersion.name, code: currentVersion.code + 1 ] + if (env.lazyInput) { + nextVersion = [ name: env.lazyInput, code: nextVersion.code ] + } sh("git checkout -b release-${env.LAZY_INPUT}") - android.gitUpdateVersion(env.LAZY_INPUT, currentVersion.code + 1) - def nextVersion = [ name: android.getVersion('versionName') as String, code: android.getVersion('versionCode') as Integer ] + androidVersion(nextVersion) + nextVersion = androidVersion() // Just to catch any problem echo("nextVersion = ${nextVersion.toString()}" ) - android.gitUpdateChangelogs(nextVersion.code) - gitPush(releaseFrom['remote'], "release-${env.LAZY_INPUT}") + androidChangelogs(nextVersion.code) + gitCommit("Provide changelogs for version ${nextVersion.code}", 'fastlane/metadata/android') + gitCommit("Update version to ${nextVersion.name}-${nextVersion.code}", 'app/build.gradle') + gitPush(releaseFrom['remote'], "release-${nextVersion.name}") }) }, on: 'android', @@ -126,7 +132,7 @@ sh("ls -lA app/build/outputs/apk") }, run: { - def currentVersion = [ name: android.getVersion('versionName') as String, code: android.getVersion('versionCode') as Integer ] + def currentVersion = androidVersion() echo("currentVersion = ${currentVersion.toString()}") if ( env.DRYRUN != 'true' ) fastlane('android', 'alpha') lazyGit.withPassword('bot-ci-dgm', { @@ -151,8 +157,8 @@ sh("ls -lA app/build/outputs/apk") }, run: { - if ( env.DRYRUN != 'true' ) fastlane('android', 'beta') -/* }, + if ( env.DRYRUN != 'true' ) fastlane('android', 'beta')/* + }, on: 'android', ] } @@ -166,8 +172,8 @@ sh("ls -lA app/build/outputs/apk") }, run: { - if ( env.DRYRUN != 'true' ) fastlane('android', 'production') -*/ def currentVersion = [ name: android.getVersion('versionName') as String, code: android.getVersion('versionCode') as Integer ] + if ( env.DRYRUN != 'true' ) fastlane('android', 'production')*/ + def currentVersion = androidVersion() echo("currentVersion = ${currentVersion.toString()}") lazyGitPass('bot-ci-dgm', { gitMerge(