fastlane-plugin-wpmreleasetoolkit 1.1.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +17 -11
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +11 -5
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +24 -24
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +25 -22
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +23 -28
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +29 -38
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +14 -7
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +8 -2
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +9 -1
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +6 -2
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +7 -1
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +7 -1
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +7 -1
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotifx_prechecks.rb +4 -4
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +9 -3
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +147 -0
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +30 -15
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb +14 -5
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +124 -46
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/filesystem_helper.rb +3 -1
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb +79 -0
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  24. metadata +18 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ea5db89dea2eb4b4879985bc5ee3d716ee8863f340ccc5fc285e34433353c51
4
- data.tar.gz: 5aa0d8e024ef9fc4efb28f455be892be78a5fd8ae58fb7b99c60c5f941a8f51f
3
+ metadata.gz: '042749ed354718f17fb9634635f8e3c06a8917d5c69ae3850ea7efd32b8b8725'
4
+ data.tar.gz: 3682297f8d2420dab3ecd457214f9ac9675efe13c5abb80673eb748ff6d71c49
5
5
  SHA512:
6
- metadata.gz: fb23526af1cee62f484c4629ea986f111ba7c0f0fa64c2a649fc9aa358fb0f5e20f07de899c8da82bea9c7dfed0fa101e2437bb6cb3354cfda0ed38ff4568d84
7
- data.tar.gz: e586e3f278be182ea75ce5023e27e2bef958a434d24228280bb8a3a29729e0a49499a26e282592d2ce136019bd02446c5c3b12501fb6b74a01f23fcc8eb983f9
6
+ metadata.gz: 5b3f91303cf1b3deff289a87f64fe92e99b71d7f78526ae4e4645691a1e8d6b224b94a66c557adca1989bc6f454d530750c7bb264ad5c0a7278d8bd963b50cbd
7
+ data.tar.gz: 91ecfd2fd9ddc7a8fe18823ab23055f708817c3cf9dcfb93e32739b008c737d195ea09035d6f9315eca96cdcc3d3f563da7697e2d086a59ffb0190e35741f9fc
@@ -11,19 +11,21 @@ module Fastlane
11
11
  # Checkout develop and update
12
12
  Fastlane::Helper::GitHelper.checkout_and_pull('develop')
13
13
 
14
+ app = params[:app]
15
+
14
16
  # Check versions
15
- release_version = Fastlane::Helper::Android::VersionHelper.get_release_version
16
- message = "The following current version has been detected: #{release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n"
17
- alpha_release_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version
18
- message << "The following Alpha version has been detected: #{alpha_release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n" unless alpha_release_version.nil?
17
+ release_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
18
+ message = "[#{app}] The following current version has been detected: #{release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n"
19
+ alpha_release_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app)
20
+ message << "[#{app}] The following Alpha version has been detected: #{alpha_release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n" unless alpha_release_version.nil?
19
21
 
20
22
  # Check branch
21
- app_version = Fastlane::Helper::Android::VersionHelper.get_public_version
23
+ app_version = Fastlane::Helper::Android::VersionHelper.get_public_version(app)
22
24
  UI.user_error!("#{message}Release branch for version #{app_version} doesn't exist. Abort.") unless !params[:base_version].nil? || Fastlane::Helper::GitHelper.checkout_and_pull(release: app_version)
23
25
 
24
26
  # Check user overwrite
25
27
  unless params[:base_version].nil?
26
- overwrite_version = get_user_build_version(params[:base_version], message)
28
+ overwrite_version = get_user_build_version(product_name: app, version: params[:base_version], message: message)
27
29
  release_version = overwrite_version[0]
28
30
  alpha_release_version = overwrite_version[1]
29
31
  end
@@ -47,11 +49,11 @@ module Fastlane
47
49
  [next_beta_version, next_alpha_version]
48
50
  end
49
51
 
50
- def self.get_user_build_version(version, message)
51
- UI.user_error!("Release branch for version #{version} doesn't exist. Abort.") unless Fastlane::Helper::GitHelper.checkout_and_pull(release: version)
52
- release_version = Fastlane::Helper::Android::VersionHelper.get_release_version
53
- message << "Looking at branch release/#{version} as requested by user. Detected version: #{release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}.\n"
54
- alpha_release_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version
52
+ def self.get_user_build_version(product_name:, version:, message:)
53
+ UI.user_error!("[#{app}] Release branch for version #{version} doesn't exist. Abort.") unless Fastlane::Helper::GitHelper.checkout_and_pull(release: version)
54
+ release_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: product_name)
55
+ message << "#{app}] Looking at branch release/#{version} as requested by user. Detected version: #{release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}.\n"
56
+ alpha_release_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version(product_name)
55
57
  message << "and Alpha Version: #{alpha_release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n" unless alpha_release_version.nil?
56
58
  [release_version, alpha_release_version]
57
59
  end
@@ -80,6 +82,10 @@ module Fastlane
80
82
  description: 'Skips confirmation',
81
83
  is_string: false, # true: verifies the input is a string, false: every kind of value
82
84
  default_value: false), # the default value if the user didn't provide one
85
+ FastlaneCore::ConfigItem.new(key: :app,
86
+ env_name: 'PROJECT_NAME',
87
+ description: 'The name of the app to get the release version for',
88
+ is_string: true), # true: verifies the input is a string, false: every kind of value
83
89
  ]
84
90
  end
85
91
 
@@ -3,20 +3,22 @@ module Fastlane
3
3
  class AndroidBuildPrechecksAction < Action
4
4
  def self.run(params)
5
5
  require_relative '../../helper/android/android_version_helper'
6
+ require_relative '../../helper/git_helper'
6
7
 
7
8
  UI.user_error!("Can't build beta and final at the same time!") if params[:final] && params[:beta]
8
9
 
9
10
  Fastlane::Helper::GitHelper.ensure_on_branch!('release') unless other_action.is_ci()
10
11
 
12
+ app = params[:app]
11
13
  message = ''
12
- beta_version = Fastlane::Helper::Android::VersionHelper.get_release_version() unless !params[:beta] && !params[:final]
13
- alpha_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version() if params[:alpha]
14
+ beta_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app) unless !params[:beta] && !params[:final]
15
+ alpha_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app) if params[:alpha]
14
16
 
15
17
  UI.user_error!("Can't build a final release out of this branch because it's configured as a beta release!") if params[:final] && Fastlane::Helper::Android::VersionHelper.is_beta_version?(beta_version)
16
18
 
17
- message << "Building version #{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Release Channel)\n" if params[:final]
18
- message << "Building version #{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Beta Channel)\n" if params[:beta]
19
- message << "Building version #{alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Alpha Channel)\n" if params[:alpha]
19
+ message << "[#{app}] Building version #{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Release Channel)\n" if params[:final]
20
+ message << "[#{app}] Building version #{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Beta Channel)\n" if params[:beta]
21
+ message << "[#{app}] Building version #{alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Alpha Channel)\n" if params[:alpha]
20
22
 
21
23
  if params[:skip_confirm]
22
24
  UI.message(message)
@@ -62,6 +64,10 @@ module Fastlane
62
64
  description: 'True if this is for a final build',
63
65
  is_string: false,
64
66
  default_value: false),
67
+ FastlaneCore::ConfigItem.new(key: :app,
68
+ env_name: 'PROJECT_NAME',
69
+ description: 'The name of the app to get the release version for',
70
+ is_string: true), # true: verifies the input is a string, false: every kind of value
65
71
  ]
66
72
  end
67
73
 
@@ -8,11 +8,22 @@ module Fastlane
8
8
  require_relative '../../helper/android/android_version_helper'
9
9
 
10
10
  Fastlane::Helper::GitHelper.ensure_on_branch!('release')
11
- create_config()
12
- show_config()
11
+ app = params[:app]
13
12
 
14
- UI.message 'Updating build.gradle...'
15
- Fastlane::Helper::Android::VersionHelper.update_versions(@new_version_beta, @new_version_alpha)
13
+ current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
14
+ current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app)
15
+ new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_beta_version(current_version, current_version_alpha)
16
+ new_version_alpha = current_version_alpha.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(new_version_beta, current_version_alpha)
17
+
18
+ vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
19
+ vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
20
+ UI.message("Current version[#{app}]: #{current_version[vname]}(#{current_version[vcode]})")
21
+ UI.message("Current alpha version[#{app}]: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil?
22
+ UI.message("New beta version[#{app}]: #{new_version_beta[vname]}(#{new_version_beta[vcode]})")
23
+ UI.message("New alpha version[#{app}]: #{new_version_alpha[vname]}(#{new_version_alpha[vcode]})") unless current_version_alpha.nil?
24
+
25
+ UI.message 'Updating app version...'
26
+ Fastlane::Helper::Android::VersionHelper.update_versions(app, new_version_beta, new_version_alpha)
16
27
  UI.message 'Done!'
17
28
 
18
29
  Fastlane::Helper::Android::GitHelper.commit_version_bump()
@@ -23,14 +34,21 @@ module Fastlane
23
34
  #####################################################
24
35
 
25
36
  def self.description
26
- 'Bumps the version of the app for a new beta'
37
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
27
38
  end
28
39
 
29
40
  def self.details
30
- 'Bumps the version of the app for a new beta'
41
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
31
42
  end
32
43
 
33
44
  def self.available_options
45
+ # Define all options your action supports.
46
+ [
47
+ FastlaneCore::ConfigItem.new(key: :app,
48
+ env_name: 'PROJECT_NAME',
49
+ description: 'The name of the app to get the release version for',
50
+ is_string: true), # true: verifies the input is a string, false: every kind of value
51
+ ]
34
52
  end
35
53
 
36
54
  def self.output
@@ -46,24 +64,6 @@ module Fastlane
46
64
  def self.is_supported?(platform)
47
65
  platform == :android
48
66
  end
49
-
50
- private
51
-
52
- def self.create_config
53
- @current_version = Fastlane::Helper::Android::VersionHelper.get_release_version()
54
- @current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version()
55
- @new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_beta_version(@current_version, @current_version_alpha)
56
- @new_version_alpha = ENV['HAS_ALPHA_VERSION'].nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(@new_version_beta, @current_version_alpha)
57
- end
58
-
59
- def self.show_config
60
- vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
61
- vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
62
- UI.message("Current version: #{@current_version[vname]}(#{@current_version[vcode]})")
63
- UI.message("Current alpha version: #{@current_version_alpha[vname]}(#{@current_version_alpha[vcode]})") unless ENV['HAS_ALPHA_VERSION'].nil?
64
- UI.message("New beta version: #{@new_version_beta[vname]}(#{@new_version_beta[vcode]})")
65
- UI.message("New alpha version: #{@new_version_alpha[vname]}(#{@new_version_alpha[vcode]})") unless ENV['HAS_ALPHA_VERSION'].nil?
66
- end
67
67
  end
68
68
  end
69
69
  end
@@ -8,11 +8,20 @@ module Fastlane
8
8
  require_relative '../../helper/android/android_version_helper'
9
9
 
10
10
  Fastlane::Helper::GitHelper.ensure_on_branch!('release')
11
- create_config()
12
- show_config()
11
+ app = params[:app]
13
12
 
14
- UI.message 'Updating gradle.properties...'
15
- Fastlane::Helper::Android::VersionHelper.update_versions(@final_version, @current_version_alpha)
13
+ current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
14
+ current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app)
15
+ final_version = Fastlane::Helper::Android::VersionHelper.calc_final_release_version(current_version, current_version_alpha)
16
+
17
+ vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
18
+ vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
19
+ UI.message("Current version[#{app}]: #{current_version[vname]}(#{current_version[vcode]})")
20
+ UI.message("Current alpha version[#{app}]: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil?
21
+ UI.message("New release version[#{app}]: #{final_version[vname]}(#{final_version[vcode]})")
22
+
23
+ UI.message 'Updating app version...'
24
+ Fastlane::Helper::Android::VersionHelper.update_versions(app, final_version, current_version_alpha)
16
25
  UI.message 'Done!'
17
26
 
18
27
  Fastlane::Helper::Android::GitHelper.commit_version_bump()
@@ -23,11 +32,21 @@ module Fastlane
23
32
  #####################################################
24
33
 
25
34
  def self.description
26
- 'Bumps the version of the app for a new beta'
35
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
27
36
  end
28
37
 
29
38
  def self.details
30
- 'Bumps the version of the app for a new beta'
39
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
40
+ end
41
+
42
+ def self.available_options
43
+ # Define all options your action supports.
44
+ [
45
+ FastlaneCore::ConfigItem.new(key: :app,
46
+ env_name: 'PROJECT_NAME',
47
+ description: 'The name of the app to get the release version for',
48
+ is_string: true), # true: verifies the input is a string, false: every kind of value
49
+ ]
31
50
  end
32
51
 
33
52
  def self.authors
@@ -37,22 +56,6 @@ module Fastlane
37
56
  def self.is_supported?(platform)
38
57
  platform == :android
39
58
  end
40
-
41
- private
42
-
43
- def self.create_config
44
- @current_version = Fastlane::Helper::Android::VersionHelper.get_release_version()
45
- @current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version()
46
- @final_version = Fastlane::Helper::Android::VersionHelper.calc_final_release_version(@current_version, @current_version_alpha)
47
- end
48
-
49
- def self.show_config
50
- vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
51
- vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
52
- UI.message("Current version: #{@current_version[vname]}(#{@current_version[vcode]})")
53
- UI.message("Current alpha version: #{@current_version_alpha[vname]}(#{@current_version_alpha[vcode]})") unless ENV['HAS_ALPHA_VERSION'].nil?
54
- UI.message("New release version: #{@final_version[vname]}(#{@final_version[vcode]})")
55
- end
56
59
  end
57
60
  end
58
61
  end
@@ -6,11 +6,21 @@ module Fastlane
6
6
 
7
7
  require_relative '../../helper/android/android_git_helper'
8
8
  Fastlane::Helper::GitHelper.create_branch("release/#{params[:version_name]}", from: params[:previous_version_name])
9
- create_config(params[:previous_version_name], params[:version_name], params[:version_code])
10
- show_config()
11
9
 
12
- UI.message 'Updating build.gradle...'
13
- Fastlane::Helper::Android::VersionHelper.update_versions(@new_version, @current_version_alpha)
10
+ app = params[:app]
11
+
12
+ current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
13
+ new_version = Fastlane::Helper::Android::VersionHelper.calc_next_hotfix_version(params[:version_name], params[:version_code]) # NOTE: this just puts the name/code values in a tuple, unchanged (no actual calc/bumping)
14
+ new_release_branch = "release/#{params[:version_name]}"
15
+
16
+ name_key = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
17
+ code_key = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
18
+ UI.message("Current version [#{app}]: #{current_version[name_key]} (#{current_version[code_key]})")
19
+ UI.message("New hotfix version[#{app}]: #{new_version[name_key]} (#{new_version[code_key]})")
20
+ UI.message("Release branch: #{new_release_branch}")
21
+
22
+ UI.message 'Updating app version...'
23
+ Fastlane::Helper::Android::VersionHelper.update_versions(app, new_version, nil)
14
24
  UI.message 'Done!'
15
25
 
16
26
  Fastlane::Helper::Android::GitHelper.commit_version_bump()
@@ -23,29 +33,30 @@ module Fastlane
23
33
  #####################################################
24
34
 
25
35
  def self.description
26
- 'Bumps the version of the app and creates the new release branch'
36
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
27
37
  end
28
38
 
29
39
  def self.details
30
- 'Bumps the version of the app and creates the new release branch'
40
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
31
41
  end
32
42
 
33
43
  def self.available_options
34
- # Define all options your action supports.
35
-
36
- # Below a few examples
37
44
  [
38
45
  FastlaneCore::ConfigItem.new(key: :version_name,
39
46
  env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_VERSION',
40
- description: 'The version of the hotfix',
47
+ description: 'The version name for the hotfix',
41
48
  is_string: true),
42
49
  FastlaneCore::ConfigItem.new(key: :version_code,
43
50
  env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_CODE',
44
- description: 'The version of the hotfix'),
51
+ description: 'The version code for the hotfix'),
45
52
  FastlaneCore::ConfigItem.new(key: :previous_version_name,
46
53
  env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_PREVIOUS_VERSION',
47
54
  description: 'The version to branch from',
48
- is_string: true), # the default value if the user didn't provide one
55
+ is_string: true),
56
+ FastlaneCore::ConfigItem.new(key: :app,
57
+ env_name: 'PROJECT_NAME',
58
+ description: 'The name of the app to get the release version for',
59
+ is_string: true),
49
60
  ]
50
61
  end
51
62
 
@@ -56,22 +67,6 @@ module Fastlane
56
67
  def self.is_supported?(platform)
57
68
  platform == :android
58
69
  end
59
-
60
- private
61
-
62
- def self.create_config(previous_version, new_version_name, new_version_code)
63
- @current_version = Fastlane::Helper::Android::VersionHelper.get_release_version()
64
- @current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version()
65
- @new_version = Fastlane::Helper::Android::VersionHelper.calc_next_hotfix_version(new_version_name, new_version_code)
66
- @new_short_version = new_version_name
67
- @new_release_branch = "release/#{@new_short_version}"
68
- end
69
-
70
- def self.show_config
71
- UI.message("Current version: #{@current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{@current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]})")
72
- UI.message("New hotfix version: #{@new_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{@new_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]})")
73
- UI.message("Release branch: #{@new_release_branch}")
74
- end
75
70
  end
76
71
  end
77
72
  end
@@ -11,17 +11,31 @@ module Fastlane
11
11
  other_action.ensure_git_branch(branch: 'develop')
12
12
 
13
13
  # Create new configuration
14
- @new_short_version = Fastlane::Helper::Android::VersionHelper.bump_version_release()
15
- create_config()
16
- show_config()
14
+ app = params[:app]
15
+ new_short_version = Fastlane::Helper::Android::VersionHelper.bump_version_release(app)
16
+
17
+ current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
18
+ current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app)
19
+ new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_release_version(current_version, current_version_alpha)
20
+ new_version_alpha = current_version_alpha.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(new_version_beta, current_version_alpha)
21
+ new_release_branch = "release/#{new_short_version}"
22
+
23
+ vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
24
+ vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
25
+ UI.message("Current version[#{app}]: #{current_version[vname]}(#{current_version[vcode]})")
26
+ UI.message("Current alpha version[#{app}]: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil?
27
+ UI.message("New beta version[#{app}]: #{new_version_beta[vname]}(#{new_version_beta[vcode]})")
28
+ UI.message("New alpha version[#{app}]: #{new_version_alpha[vname]}(#{new_version_alpha[vcode]})") unless current_version_alpha.nil?
29
+ UI.message("New version[#{app}]: #{new_short_version}")
30
+ UI.message("Release branch: #{new_release_branch}")
17
31
 
18
32
  # Update local develop and branch
19
33
  UI.message 'Creating new branch...'
20
- Fastlane::Helper::GitHelper.create_branch(@new_release_branch, from: 'develop')
34
+ Fastlane::Helper::GitHelper.create_branch(new_release_branch, from: 'develop')
21
35
  UI.message 'Done!'
22
36
 
23
- UI.message 'Updating versions...'
24
- Fastlane::Helper::Android::VersionHelper.update_versions(@new_version_beta, @new_version_alpha)
37
+ UI.message 'Updating app version...'
38
+ Fastlane::Helper::Android::VersionHelper.update_versions(app, new_version_beta, new_version_alpha)
25
39
  Fastlane::Helper::Android::GitHelper.commit_version_bump()
26
40
  UI.message 'Done.'
27
41
  end
@@ -31,14 +45,21 @@ module Fastlane
31
45
  #####################################################
32
46
 
33
47
  def self.description
34
- 'Bumps the version of the app and creates the new release branch'
48
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
35
49
  end
36
50
 
37
51
  def self.details
38
- 'Bumps the version of the app and creates the new release branch'
52
+ 'Bumps the version of the app for a new beta. Requires the `updateVersionProperties` gradle task to update the keys if you are using a `version.properties` file.'
39
53
  end
40
54
 
41
55
  def self.available_options
56
+ # Define all options your action supports.
57
+ [
58
+ FastlaneCore::ConfigItem.new(key: :app,
59
+ env_name: 'PROJECT_NAME',
60
+ description: 'The name of the app to get the release version for',
61
+ is_string: true), # true: verifies the input is a string, false: every kind of value
62
+ ]
42
63
  end
43
64
 
44
65
  def self.output
@@ -54,36 +75,6 @@ module Fastlane
54
75
  def self.is_supported?(platform)
55
76
  platform == :android
56
77
  end
57
-
58
- private
59
-
60
- def self.create_config
61
- @current_version = Fastlane::Helper::Android::VersionHelper.get_release_version()
62
- @current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version()
63
- @new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_release_version(@current_version, @current_version_alpha)
64
- @new_version_alpha = ENV['HAS_ALPHA_VERSION'].nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(@new_version_beta, @current_version_alpha)
65
- @new_release_branch = "release/#{@new_short_version}"
66
- end
67
-
68
- def self.show_config
69
- vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
70
- vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
71
- UI.message("Current version: #{@current_version[vname]}(#{@current_version[vcode]})")
72
- UI.message("Current alpha version: #{@current_version_alpha[vname]}(#{@current_version_alpha[vcode]})") unless ENV['HAS_ALPHA_VERSION'].nil?
73
- UI.message("New beta version: #{@new_version_beta[vname]}(#{@new_version_beta[vcode]})")
74
- UI.message("New alpha version: #{@new_version_alpha[vname]}(#{@new_version_alpha[vcode]})") unless ENV['HAS_ALPHA_VERSION'].nil?
75
- UI.message("New version: #{@new_short_version}")
76
- UI.message("Release branch: #{@new_release_branch}")
77
- end
78
-
79
- def self.update_glotpress_key
80
- dm_file = ENV['DOWNLOAD_METADATA']
81
- if File.exist?(dm_file)
82
- sh("sed -i '' \"s/let glotPressWhatsNewKey.*/let glotPressWhatsNewKey = \\\"v#{@new_short_version}-whats-new\\\"/\" #{dm_file}")
83
- else
84
- UI.user_error!("Can't find #{dm_file}.")
85
- end
86
- end
87
78
  end
88
79
  end
89
80
  end
@@ -14,18 +14,21 @@ module Fastlane
14
14
  # Checkout develop and update
15
15
  Fastlane::Helper::GitHelper.checkout_and_pull('develop')
16
16
 
17
+ app = params[:app]
18
+
17
19
  # Create versions
18
- current_version = Fastlane::Helper::Android::VersionHelper.get_release_version
19
- current_alpha_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version
20
+ current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
21
+ current_alpha_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app)
20
22
  next_version = Fastlane::Helper::Android::VersionHelper.calc_next_release_version(current_version, current_alpha_version)
21
- next_alpha_version = ENV['HAS_ALPHA_VERSION'].nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(next_version, current_alpha_version)
23
+ next_alpha_version = current_alpha_version.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(next_version, current_alpha_version)
22
24
 
25
+ no_alpha_version_message = "No alpha version configured. If you wish to configure an alpha version please update version.properties to include an alpha key for this app\n"
23
26
  # Ask user confirmation
24
27
  unless params[:skip_confirm]
25
- confirm_message = "Building a new release branch starting from develop.\nCurrent version is #{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
26
- confirm_message += ENV['HAS_ALPHA_VERSION'].nil? ? "No alpha version configured.\n" : "Current Alpha version is #{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
28
+ confirm_message = "[#{app}]Building a new release branch starting from develop.\nCurrent version is #{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
29
+ confirm_message += current_alpha_version.nil? ? no_alpha_version_message : "Current Alpha version is #{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
27
30
  confirm_message += "After codefreeze the new version will be: #{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
28
- confirm_message += ENV['HAS_ALPHA_VERSION'].nil? ? '' : "After codefreeze the new Alpha will be: #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
31
+ confirm_message += current_alpha_version.nil? ? '' : "After codefreeze the new Alpha will be: #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
29
32
  confirm_message += 'Do you want to continue?'
30
33
  UI.user_error!('Aborted by user request') unless UI.confirm(confirm_message)
31
34
  end
@@ -34,7 +37,7 @@ module Fastlane
34
37
  other_action.ensure_git_status_clean()
35
38
 
36
39
  # Return the current version
37
- Fastlane::Helper::Android::VersionHelper.get_public_version
40
+ Fastlane::Helper::Android::VersionHelper.get_public_version(app)
38
41
  end
39
42
 
40
43
  #####################################################
@@ -57,6 +60,10 @@ module Fastlane
57
60
  description: 'Skips confirmation before codefreeze',
58
61
  is_string: false, # true: verifies the input is a string, false: every kind of value
59
62
  default_value: false), # the default value if the user didn't provide one
63
+ FastlaneCore::ConfigItem.new(key: :app,
64
+ env_name: 'PROJECT_NAME',
65
+ description: 'The name of the app to get the release version for',
66
+ is_string: true), # true: verifies the input is a string, false: every kind of value
60
67
  ]
61
68
  end
62
69