fastlane-plugin-wpmreleasetoolkit 8.0.1 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +7 -7
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +1 -1
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +1 -1
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +2 -2
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +1 -1
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +1 -1
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +3 -2
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +1 -1
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +3 -3
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +4 -4
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +1 -1
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +1 -1
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +1 -1
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotfix_prechecks.rb +1 -1
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +1 -1
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +1 -1
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +1 -1
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +4 -3
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +3 -3
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/find_previous_tag.rb +58 -0
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb +112 -0
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +13 -6
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +3 -3
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +24 -24
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb +37 -5
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +3 -3
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb +3 -3
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +2 -2
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +3 -3
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +2 -2
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +2 -2
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +1 -1
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +4 -4
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +1 -1
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +5 -7
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +3 -22
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +6 -20
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +1 -1
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +1 -1
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +11 -4
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +1 -1
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +2 -2
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +2 -2
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +4 -4
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +2 -2
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +6 -6
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +39 -41
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +10 -11
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +1 -1
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +1 -1
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +39 -1
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +2 -2
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb +2 -55
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +3 -3
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +42 -52
  59. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +26 -16
  60. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +2 -2
  61. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +11 -11
  62. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +3 -1
  63. metadata +26 -13
  64. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +0 -66
  65. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +0 -43
  66. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +0 -40
@@ -15,28 +15,28 @@ module Fastlane
15
15
 
16
16
  helper.check_fonts_installed!(config: config) unless params[:skip_font_check]
17
17
 
18
- translationDirectories = subdirectories_for_path(params[:metadata_folder])
19
- imageDirectories = subdirectories_for_path(params[:orig_folder])
18
+ translation_directories = subdirectories_for_path(params[:metadata_folder])
19
+ image_directories = subdirectories_for_path(params[:orig_folder])
20
20
 
21
- unless helper.can_resolve_path(params[:output_folder])
21
+ if helper.can_resolve_path(params[:output_folder])
22
+ UI.message "#{self.check_path(params[:output_folder])} Output Folder: #{params[:output_folder]}"
23
+ else
22
24
  UI.message "✅ Created Output Folder: #{params[:output_folder]}"
23
25
  FileUtils.mkdir_p(params[:output_folder])
24
- else
25
- UI.message "#{self.check_path(params[:output_folder])} Output Folder: #{params[:output_folder]}"
26
26
  end
27
27
 
28
- outputDirectory = helper.resolve_path(params[:output_folder])
28
+ output_directory = helper.resolve_path(params[:output_folder])
29
29
 
30
30
  ## If there are no translated screenshot images (whether it's because they haven't been generated yet,
31
31
  ## or because we aren't using them), just use the translated directories.
32
- languages = if imageDirectories == []
33
- translationDirectories
32
+ languages = if image_directories == []
33
+ translation_directories
34
34
  ## And vice-versa.
35
- elsif translationDirectories == []
36
- imageDirectories
35
+ elsif translation_directories == []
36
+ image_directories
37
37
  ## If there are original screenshots and translations available, use only locales that exist in both.
38
38
  else
39
- imageDirectories & translationDirectories
39
+ image_directories & translation_directories
40
40
  end
41
41
 
42
42
  UI.message("💙 Creating Promo Screenshots for: #{languages.join(', ')}")
@@ -49,7 +49,7 @@ module Fastlane
49
49
 
50
50
  stylesheet_path = config['stylesheet']
51
51
 
52
- entries = build_entries(config['entries'], languages, outputDirectory, params)
52
+ entries = build_entries(config['entries'], languages, output_directory, params)
53
53
 
54
54
  bar = ProgressBar.new(entries.count, :bar, :counter, :eta, :rate)
55
55
 
@@ -183,32 +183,32 @@ module Fastlane
183
183
  config_entries
184
184
  .flat_map do |entry|
185
185
  languages.map do |language|
186
- newEntry = entry.deep_dup
186
+ new_entry = entry.deep_dup
187
187
 
188
188
  # Not every output file will have a screenshot, so handle cases where no
189
189
  # screenshot file is defined
190
190
  if !entry['screenshot'].nil? && !entry['filename'].nil?
191
- newEntry['screenshot'] = helper.resolve_path(params[:orig_folder]) + language + entry['screenshot']
192
- newEntry['filename'] = output_directory + language + entry['filename']
191
+ new_entry['screenshot'] = helper.resolve_path(params[:orig_folder]) + language + entry['screenshot']
192
+ new_entry['filename'] = output_directory + language + entry['filename']
193
193
  elsif !entry['screenshot'].nil? && entry['filename'].nil?
194
- newEntry['screenshot'] = helper.resolve_path(params[:orig_folder]) + language + entry['screenshot']
195
- newEntry['filename'] = output_directory + language + entry['screenshot']
194
+ new_entry['screenshot'] = helper.resolve_path(params[:orig_folder]) + language + entry['screenshot']
195
+ new_entry['filename'] = output_directory + language + entry['screenshot']
196
196
  elsif entry['screenshot'].nil? && !entry['filename'].nil?
197
- newEntry['filename'] = output_directory + language + entry['filename']
197
+ new_entry['filename'] = output_directory + language + entry['filename']
198
198
  else
199
- puts newEntry
199
+ puts new_entry
200
200
  abort 'Unable to find output file names'
201
201
  end
202
202
 
203
- newEntry['locale'] = language
203
+ new_entry['locale'] = language
204
204
 
205
205
  # Localize file paths for text
206
- newEntry['text'].sub!('{locale}', language.dup) unless entry['text'].nil?
206
+ new_entry['text'].sub!('{locale}', language.dup) unless entry['text'].nil?
207
207
 
208
208
  # Map attachments paths to their localized versions
209
- newEntry['attachments'] = [] if newEntry['attachments'].nil?
209
+ new_entry['attachments'] = [] if new_entry['attachments'].nil?
210
210
 
211
- newEntry['attachments'].each do |attachment|
211
+ new_entry['attachments'].each do |attachment|
212
212
  ## If there are no translated screenshot images (whether it's because they haven't been generated yet,
213
213
  ## or because we aren't using them), just use the translated directories.
214
214
  ## And vice-versa.
@@ -240,7 +240,7 @@ module Fastlane
240
240
  attachment['text']&.sub!('{locale}', language.dup)
241
241
  end
242
242
 
243
- newEntry
243
+ new_entry
244
244
  end
245
245
  end
246
246
  .sort do |x, y|
@@ -22,18 +22,25 @@ module Fastlane
22
22
 
23
23
  if file_is_already_uploaded?(bucket, key)
24
24
  message = "File already exists in S3 bucket #{bucket} at #{key}"
25
- if params[:skip_if_exists]
25
+
26
+ # skip_if_exists is deprecated but we want to keep backward compatibility.
27
+ params[:if_exists] ||= params[:skip_if_exists] ? :skip : :fail
28
+
29
+ case params[:if_exists]
30
+ when :fail
31
+ UI.user_error!(message)
32
+ when :replace
33
+ UI.important("#{message}. Will replace with the given one.")
34
+ when :skip
26
35
  UI.important("#{message}. Skipping upload.")
27
36
  return key
28
- else
29
- UI.user_error!(message)
30
37
  end
31
38
  end
32
39
 
33
40
  UI.message("Uploading #{file_path} to: #{key}")
34
41
 
35
42
  File.open(file_path, 'rb') do |file|
36
- Aws::S3::Client.new().put_object(
43
+ Aws::S3::Client.new.put_object(
37
44
  body: file,
38
45
  bucket: bucket,
39
46
  key: key
@@ -50,7 +57,7 @@ module Fastlane
50
57
  end
51
58
 
52
59
  def self.file_is_already_uploaded?(bucket, key)
53
- response = Aws::S3::Client.new().head_object(
60
+ response = Aws::S3::Client.new.head_object(
54
61
  bucket: bucket,
55
62
  key: key
56
63
  )
@@ -112,10 +119,35 @@ module Fastlane
112
119
  FastlaneCore::ConfigItem.new(
113
120
  key: :skip_if_exists,
114
121
  description: 'If the file already exists in the S3 bucket, skip the upload (and report it in the logs), instead of failing with `user_error!`',
122
+ deprecated: 'Use if_exists instead',
123
+ conflicting_options: [:if_exists],
124
+ conflict_block: proc do |option|
125
+ UI.user_error!("You cannot set both :#{option.key} and :skip_if_exists. Please only use :if_exists.")
126
+ end,
115
127
  optional: true,
128
+ # This option is deprecated but we stil set a default value to inform that the default behavior is for the action to fail when printing the action docs.
129
+ # See also https://github.com/wordpress-mobile/release-toolkit/pull/500#discussion_r1239642179
116
130
  default_value: false,
117
131
  type: Boolean
118
132
  ),
133
+ FastlaneCore::ConfigItem.new(
134
+ key: :if_exists,
135
+ description: 'What do to if the file file already exists in the S3 bucket. Possible values :skip, :replace, :fail. When set, overrides the deprecated skip_if_exists option',
136
+ conflicting_options: [:skip_if_exists],
137
+ conflict_block: proc do |option|
138
+ UI.user_error!("You cannot set both :#{option.key} and :if_exists. Please only use :if_exists.")
139
+ end,
140
+ optional: true,
141
+ type: Symbol,
142
+ # We cannot set a default value and have backward compatibility with skip_if_exists at the same time.
143
+ # (Short of duplicating the default value knowledge in the action implementation)
144
+ #
145
+ # We have a test for the default behavior which should hopefully remind us to uncomment this line once well remove skip_if_exists.
146
+ # default_value: :fail,
147
+ verify_block: proc do |value|
148
+ UI.user_error!('`if_exist` must be one of :skip, :replace, :fail') unless %i[skip replace fail].include?(value)
149
+ end
150
+ ),
119
151
  ]
120
152
  end
121
153
 
@@ -40,13 +40,13 @@ module Fastlane
40
40
  UI.message 'Example: google-services.json'
41
41
 
42
42
  source = UI.input('Source File Path:')
43
- sourcePath = absolute_secret_store_path(source) # Transform the relative path into an absolute path.
43
+ source_path = absolute_secret_store_path(source) # Transform the relative path into an absolute path.
44
44
 
45
45
  # Don't allow the developer to accidentally specify an invalid file, otherwise validation will never succeed.
46
- if File.file?(sourcePath)
46
+ if File.file?(source_path)
47
47
  invalid_file = false
48
48
  else
49
- UI.error "There is no file at #{sourcePath}."
49
+ UI.error "There is no file at #{source_path}."
50
50
  end
51
51
  end
52
52
 
@@ -9,10 +9,10 @@ module Fastlane
9
9
  UI.message 'Running Configure Download'
10
10
 
11
11
  # If the `~/.mobile-secrets` repository doesn't exist
12
- unless File.directory?(secrets_dir)
13
- UI.user_error!("The local secrets store does not exist. Please clone it to #{secrets_dir} before continuing.")
14
- else
12
+ if File.directory?(secrets_dir)
15
13
  update_repository # If the repo already exists, just update it
14
+ else
15
+ UI.user_error!("The local secrets store does not exist. Please clone it to #{secrets_dir} before continuing.")
16
16
  end
17
17
  end
18
18
 
@@ -50,8 +50,8 @@ module Fastlane
50
50
  new_branch = UI.select("Select the branch you'd like to switch to: ", get_branches)
51
51
  checkout_branch(new_branch)
52
52
  update_configure_file
53
- else
54
- UI.user_error!('The local secrets store is in a deatched HEAD state. Please check out a branch and try again.') if current_branch.nil?
53
+ elsif current_branch.nil?
54
+ UI.user_error!('The local secrets store is in a deatched HEAD state. Please check out a branch and try again.')
55
55
  end
56
56
  end
57
57
 
@@ -91,10 +91,10 @@ module Fastlane
91
91
  source = absolute_secret_store_path(x.file)
92
92
  destination = absolute_project_path(x.destination)
93
93
 
94
- sourceHash = file_hash(source)
95
- destinationHash = file_hash(destination)
94
+ source_hash = file_hash(source)
95
+ destination_hash = file_hash(destination)
96
96
 
97
- UI.user_error!("`#{x.destination} doesn't match the file in the secrets repository (#{x.file}) – unable to continue") unless sourceHash == destinationHash
97
+ UI.user_error!("`#{x.destination} doesn't match the file in the secrets repository (#{x.file}) – unable to continue") unless source_hash == destination_hash
98
98
  end
99
99
  end
100
100
 
@@ -17,7 +17,7 @@ module Fastlane
17
17
  profile.is_a? Spaceship::Portal::ProvisioningProfile::Development
18
18
  end
19
19
  .tap do |profiles|
20
- UI.important "Warning: Unable to find any profiles associated with #{identifier}" unless profiles.length > 0
20
+ UI.important "Warning: Unable to find any profiles associated with #{identifier}" if profiles.empty?
21
21
  end
22
22
  .each do |profile|
23
23
  profile.certificates = all_certificates
@@ -51,7 +51,7 @@ module Fastlane
51
51
  description: 'The team_id for the provisioning profiles',
52
52
  type: String,
53
53
  verify_block: proc do |value|
54
- UI.user_error!('You must provide a team ID in `team_id`') unless value && (!value.empty?)
54
+ UI.user_error!('You must provide a team ID in `team_id`') unless value && !value.empty?
55
55
  end),
56
56
  ]
57
57
  end
@@ -15,7 +15,7 @@ module Fastlane
15
15
  profile.is_a? Spaceship::Portal::ProvisioningProfile::Development
16
16
  end
17
17
  .tap do |profiles|
18
- UI.important "Warning: Unable to find any profiles associated with #{identifier}" unless profiles.length > 0
18
+ UI.important "Warning: Unable to find any profiles associated with #{identifier}" if profiles.empty?
19
19
  end
20
20
  .each do |profile|
21
21
  profile.devices = devices
@@ -52,7 +52,7 @@ module Fastlane
52
52
  description: 'The team_id for the provisioning profiles',
53
53
  type: String,
54
54
  verify_block: proc do |value|
55
- UI.user_error!('You must provide a team ID in `team_id`') unless value && (!value.empty?)
55
+ UI.user_error!('You must provide a team ID in `team_id`') unless value && !value.empty?
56
56
  end
57
57
  ),
58
58
  ]
@@ -33,7 +33,7 @@ module Fastlane
33
33
  end
34
34
 
35
35
  # Check local repo status
36
- other_action.ensure_git_status_clean()
36
+ other_action.ensure_git_status_clean
37
37
 
38
38
  # Return the current version
39
39
  build_version
@@ -5,9 +5,9 @@ module Fastlane
5
5
  require_relative '../../helper/ios/ios_version_helper'
6
6
 
7
7
  message = ''
8
- message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_internal_version()} and uploading to App Center\n" if params[:internal]
9
- message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version()} and uploading to App Center\n" if params[:internal_on_single_version]
10
- message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version()} and uploading to TestFlight\n" if params[:external]
8
+ message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_internal_version} and uploading to App Center\n" if params[:internal]
9
+ message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version} and uploading to App Center\n" if params[:internal_on_single_version]
10
+ message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version} and uploading to TestFlight\n" if params[:external]
11
11
 
12
12
  if params[:skip_confirm]
13
13
  UI.message(message)
@@ -16,7 +16,7 @@ module Fastlane
16
16
  end
17
17
 
18
18
  # Check local repo status
19
- other_action.ensure_git_status_clean() unless other_action.is_ci()
19
+ other_action.ensure_git_status_clean unless other_action.is_ci
20
20
  end
21
21
 
22
22
  #####################################################
@@ -33,7 +33,7 @@ module Fastlane
33
33
  raise
34
34
  end
35
35
 
36
- other_action.cocoapods()
36
+ other_action.cocoapods
37
37
  end
38
38
 
39
39
  #####################################################
@@ -8,14 +8,14 @@ module Fastlane
8
8
  require_relative '../../helper/ios/ios_version_helper'
9
9
 
10
10
  Fastlane::Helper::GitHelper.ensure_on_branch!('release')
11
- create_config()
12
- show_config()
11
+ create_config
12
+ show_config
13
13
 
14
14
  UI.message 'Updating XcConfig...'
15
15
  Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_beta_version, @short_version, @new_internal_version)
16
16
  UI.message 'Done!'
17
17
 
18
- Fastlane::Helper::Ios::GitHelper.commit_version_bump(include_deliverfile: false, include_metadata: false)
18
+ Fastlane::Helper::Ios::GitHelper.commit_version_bump
19
19
  end
20
20
 
21
21
  #####################################################
@@ -47,11 +47,9 @@ module Fastlane
47
47
  [:ios, :mac].include?(platform)
48
48
  end
49
49
 
50
- private
51
-
52
50
  def self.create_config
53
- @current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version()
54
- @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version() unless ENV['INTERNAL_CONFIG_FILE'].nil?
51
+ @current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version
52
+ @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
55
53
  @new_internal_version = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@current_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
56
54
  @new_beta_version = Fastlane::Helper::Ios::VersionHelper.calc_next_build_version(@current_version)
57
55
  @short_version = Fastlane::Helper::Ios::VersionHelper.get_short_version_string(@new_beta_version)
@@ -7,20 +7,13 @@ module Fastlane
7
7
  require_relative '../../helper/ios/ios_git_helper'
8
8
  Fastlane::Helper::GitHelper.create_branch("release/#{params[:version]}", from: params[:previous_version])
9
9
  create_config(params[:previous_version], params[:version])
10
- show_config()
11
-
12
- update_deliverfile = params[:skip_deliver] == false
13
- if update_deliverfile
14
- UI.message 'Updating Fastlane deliver file...'
15
- Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version)
16
- UI.message 'Done!'
17
- end
10
+ show_config
18
11
 
19
12
  UI.message 'Updating XcConfig...'
20
13
  Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal)
21
14
  UI.message 'Done!'
22
15
 
23
- Fastlane::Helper::Ios::GitHelper.commit_version_bump(include_deliverfile: update_deliverfile, include_metadata: false)
16
+ Fastlane::Helper::Ios::GitHelper.commit_version_bump
24
17
 
25
18
  UI.message 'Done.'
26
19
  end
@@ -51,16 +44,6 @@ module Fastlane
51
44
  description: 'The version to branch from',
52
45
  type: String
53
46
  ),
54
- FastlaneCore::ConfigItem.new(
55
- key: :skip_deliver,
56
- env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_SKIP_DELIVER',
57
- description: 'Skips Deliverfile key update',
58
- type: Boolean,
59
- optional: true,
60
- # Don't skip the Deliverfile by default. At the time of writing, 2 out of 3 consumers
61
- # still have a Deliverfile.
62
- default_value: false
63
- ),
64
47
  ]
65
48
  end
66
49
 
@@ -78,11 +61,9 @@ module Fastlane
78
61
  [:ios, :mac].include?(platform)
79
62
  end
80
63
 
81
- private
82
-
83
64
  def self.create_config(previous_version, new_short_version)
84
65
  @current_version = previous_version
85
- @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version() unless ENV['INTERNAL_CONFIG_FILE'].nil?
66
+ @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
86
67
  @new_version = "#{new_short_version}.0"
87
68
  @new_version_internal = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@new_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
88
69
  @new_short_version = new_short_version
@@ -12,27 +12,20 @@ module Fastlane
12
12
  other_action.ensure_git_branch(branch: default_branch)
13
13
 
14
14
  # Create new configuration
15
- @new_version = Fastlane::Helper::Ios::VersionHelper.bump_version_release()
16
- create_config()
17
- show_config()
15
+ @new_version = Fastlane::Helper::Ios::VersionHelper.bump_version_release
16
+ create_config
17
+ show_config
18
18
 
19
19
  # Update local default branch and create branch from it
20
20
  Fastlane::Helper::GitHelper.checkout_and_pull(default_branch)
21
21
  Fastlane::Helper::GitHelper.create_branch(@new_release_branch, from: default_branch)
22
22
  UI.message 'Done!'
23
23
 
24
- UI.message 'Updating Fastlane deliver file...' unless params[:skip_deliver]
25
- Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version) unless params[:skip_deliver]
26
- UI.message 'Done!' unless params[:skip_deliver]
27
-
28
24
  UI.message 'Updating XcConfig...'
29
25
  Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal)
30
26
  UI.message 'Done!'
31
27
 
32
- Fastlane::Helper::Ios::GitHelper.commit_version_bump(
33
- include_deliverfile: !params[:skip_deliver],
34
- include_metadata: false
35
- )
28
+ Fastlane::Helper::Ios::GitHelper.commit_version_bump
36
29
 
37
30
  UI.message 'Done.'
38
31
  end
@@ -51,11 +44,6 @@ module Fastlane
51
44
 
52
45
  def self.available_options
53
46
  [
54
- FastlaneCore::ConfigItem.new(key: :skip_deliver,
55
- env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPDELIVER',
56
- description: 'Skips Deliver key update',
57
- type: Boolean,
58
- default_value: false),
59
47
  FastlaneCore::ConfigItem.new(key: :default_branch,
60
48
  env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
61
49
  description: 'Default branch of the repository',
@@ -78,11 +66,9 @@ module Fastlane
78
66
  [:ios, :mac].include?(platform)
79
67
  end
80
68
 
81
- private
82
-
83
69
  def self.create_config
84
- @current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version()
85
- @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version() unless ENV['INTERNAL_CONFIG_FILE'].nil?
70
+ @current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version
71
+ @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
86
72
  @new_version_internal = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@new_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
87
73
  @new_short_version = Fastlane::Helper::Ios::VersionHelper.get_short_version_string(@new_version)
88
74
  @new_release_branch = "release/#{@new_short_version}"
@@ -23,7 +23,7 @@ module Fastlane
23
23
  end
24
24
 
25
25
  # Check local repo status
26
- other_action.ensure_git_status_clean()
26
+ other_action.ensure_git_status_clean
27
27
 
28
28
  # Return the current version
29
29
  current_version
@@ -20,7 +20,7 @@ module Fastlane
20
20
  end
21
21
 
22
22
  # Check local repo status
23
- other_action.ensure_git_status_clean()
23
+ other_action.ensure_git_status_clean
24
24
 
25
25
  version
26
26
  end
@@ -20,7 +20,7 @@ module Fastlane
20
20
  end
21
21
 
22
22
  # Check local repo status
23
- other_action.ensure_git_status_clean()
23
+ other_action.ensure_git_status_clean
24
24
 
25
25
  version
26
26
  end
@@ -4,9 +4,8 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require_relative '../../helper/ios/ios_version_helper'
6
6
 
7
- UI.user_error!('You need to set at least the PUBLIC_CONFIG_FILE env var to the path to the public xcconfig file') unless ENV['PUBLIC_CONFIG_FILE']
8
-
9
- Fastlane::Helper::Ios::VersionHelper.get_public_version
7
+ public_version_xcconfig_file = params[:public_version_xcconfig_file]
8
+ Fastlane::Helper::Ios::VersionHelper.get_xcconfig_public_version(xcconfig_file: public_version_xcconfig_file)
10
9
  end
11
10
 
12
11
  #####################################################
@@ -22,7 +21,15 @@ module Fastlane
22
21
  end
23
22
 
24
23
  def self.available_options
25
- # Define all options your action supports.
24
+ [
25
+ FastlaneCore::ConfigItem.new(
26
+ key: :public_version_xcconfig_file,
27
+ env_name: 'FL_IOS_PUBLIC_VERSION_XCCONFIG_FILE',
28
+ description: 'Path to the .xcconfig file containing the public app version',
29
+ type: String,
30
+ optional: false
31
+ ),
32
+ ]
26
33
  end
27
34
 
28
35
  def self.output
@@ -28,7 +28,7 @@ module Fastlane
28
28
  UI.crash!("Version #{prev_ver} is not tagged! Can't branch. Abort!") unless other_action.git_tag_exists(tag: prev_ver)
29
29
 
30
30
  # Check local repo status
31
- other_action.ensure_git_status_clean()
31
+ other_action.ensure_git_status_clean
32
32
 
33
33
  # Return the current version
34
34
  prev_ver
@@ -68,7 +68,7 @@ module Fastlane
68
68
  duplicate_keys
69
69
  end
70
70
 
71
- RETRY_MESSAGE = <<~MSG
71
+ RETRY_MESSAGE = <<~MSG.freeze
72
72
  Inconsistencies found during Localization linting.
73
73
  You need to fix them before continuing. From this point on, you should either:
74
74
 
@@ -91,7 +91,7 @@ module Fastlane
91
91
  Did you fix the `.strings` files locally and want to lint them again?
92
92
  MSG
93
93
 
94
- ABORT_MESSAGE = <<~MSG
94
+ ABORT_MESSAGE = <<~MSG.freeze
95
95
  Inconsistencies found during Localization linting. Aborting.
96
96
  MSG
97
97
 
@@ -5,8 +5,8 @@ module Fastlane
5
5
  require_relative '../../helper/ios/ios_version_helper'
6
6
  require_relative '../../helper/ios/ios_git_helper'
7
7
 
8
- itc_ver = Fastlane::Helper::Ios::VersionHelper.get_build_version()
9
- int_ver = Fastlane::Helper::Ios::VersionHelper.get_internal_version() unless ENV['INTERNAL_CONFIG_FILE'].nil?
8
+ itc_ver = Fastlane::Helper::Ios::VersionHelper.get_build_version
9
+ int_ver = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
10
10
  Fastlane::Helper::GitHelper.create_tag(itc_ver)
11
11
  Fastlane::Helper::GitHelper.create_tag(int_ver) unless int_ver.nil?
12
12
  end
@@ -3,7 +3,7 @@ module Fastlane
3
3
  class IosUpdateMetadataSourceAction < Action
4
4
  def self.run(params)
5
5
  # Check local repo status
6
- other_action.ensure_git_status_clean()
6
+ other_action.ensure_git_status_clean
7
7
 
8
8
  other_action.gp_update_metadata_source(po_file_path: params[:po_file_path],
9
9
  source_files: params[:source_files],
@@ -43,21 +43,21 @@ module Fastlane
43
43
  description: 'The path of the .po file to update',
44
44
  type: String,
45
45
  verify_block: proc do |value|
46
- UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && (!value.empty?)
46
+ UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && !value.empty?
47
47
  UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
48
48
  end),
49
49
  FastlaneCore::ConfigItem.new(key: :release_version,
50
50
  env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_RELEASE_VERSION',
51
51
  description: 'The release version of the app (to use to mark the release notes)',
52
52
  verify_block: proc do |value|
53
- UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && (!value.empty?)
53
+ UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && !value.empty?
54
54
  end),
55
55
  FastlaneCore::ConfigItem.new(key: :source_files,
56
56
  env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_SOURCE_FILES',
57
57
  description: 'The hash with the path to the source files and the key to use to include their content',
58
58
  type: Hash,
59
59
  verify_block: proc do |value|
60
- UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && (!value.empty?)
60
+ UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && !value.empty?
61
61
  end),
62
62
  ]
63
63
  end
@@ -5,8 +5,8 @@ module Fastlane
5
5
  require_relative '../../helper/ios/ios_git_helper'
6
6
  require_relative '../../helper/ios/ios_version_helper'
7
7
 
8
- version = Fastlane::Helper::Ios::VersionHelper.get_public_version()
9
- head_tags = Fastlane::Helper::GitHelper.list_tags_on_current_commit()
8
+ version = Fastlane::Helper::Ios::VersionHelper.get_public_version
9
+ head_tags = Fastlane::Helper::GitHelper.list_tags_on_current_commit
10
10
  UI.user_error!('HEAD is not on tag. Aborting!') if head_tags.empty?
11
11
 
12
12
  return head_tags.include?(version) # Current commit is tagged with "version" tag