fastlane-plugin-wpmreleasetoolkit 7.0.0 → 7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +5 -5
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +17 -5
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +2 -2
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +4 -4
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +2 -2
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +1 -1
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +4 -2
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +4 -4
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +1 -1
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +4 -2
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotfix_prechecks.rb +2 -2
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +1 -1
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +2 -2
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +10 -2
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_for_toolkit_updates_action.rb +4 -4
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +2 -2
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +3 -3
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +2 -2
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +3 -3
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +2 -2
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +4 -4
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +5 -5
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb +1 -1
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +2 -2
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_apply_action.rb +1 -1
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +1 -1
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +2 -2
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +2 -2
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +3 -3
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +4 -4
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +1 -1
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +3 -3
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +1 -1
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +15 -3
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +4 -2
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb +1 -1
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_extract_keys_from_strings_files.rb +2 -2
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +15 -3
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +4 -2
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb +3 -3
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_number.rb +54 -0
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +1 -1
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +2 -2
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +3 -3
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +2 -2
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +2 -2
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +2 -2
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +2 -2
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +2 -2
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +17 -0
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb +1 -1
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +1 -1
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +2 -2
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +1 -1
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +1 -1
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  59. metadata +5 -4
@@ -63,12 +63,12 @@ module Fastlane
63
63
  FastlaneCore::ConfigItem.new(key: :base_version,
64
64
  env_name: 'FL_IOS_BETABUILD_PRECHECKS_BASE_VERSION',
65
65
  description: 'The version to work on', # a short description of this parameter
66
- is_string: true,
67
- optional: true), # true: verifies the input is a string, false: every kind of value),
66
+ type: String,
67
+ optional: true),
68
68
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
69
69
  env_name: 'FL_IOS_BETABUILD_PRECHECKS_SKIPCONFIRM',
70
70
  description: 'Skips confirmation',
71
- is_string: false, # true: verifies the input is a string, false: every kind of value
71
+ type: Boolean,
72
72
  default_value: false), # the default value if the user didn't provide one
73
73
  FastlaneCore::ConfigItem.new(key: :default_branch,
74
74
  env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
@@ -36,22 +36,22 @@ module Fastlane
36
36
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
37
37
  env_name: 'FL_IOS_BUILD_PRECHECKS_SKIP_CONFIRM',
38
38
  description: 'True to avoid the system ask for confirmation',
39
- is_string: false,
39
+ type: Boolean,
40
40
  default_value: false),
41
41
  FastlaneCore::ConfigItem.new(key: :internal,
42
42
  env_name: 'FL_IOS_BUILD_PRECHECKS_INTERNAL_BUILD',
43
43
  description: 'True if this is for an internal build',
44
- is_string: false,
44
+ type: Boolean,
45
45
  default_value: false),
46
46
  FastlaneCore::ConfigItem.new(key: :external,
47
47
  env_name: 'FL_IOS_BUILD_PRECHECKS_EXTERNAL_BUILD',
48
48
  description: 'True if this is for a public build',
49
- is_string: false,
49
+ type: Boolean,
50
50
  default_value: false),
51
51
  FastlaneCore::ConfigItem.new(key: :internal_on_single_version,
52
52
  env_name: 'FL_IOS_BUILD_PRECHECKS_INTERNAL_SV_BUILD',
53
53
  description: 'True if this is for an internal build that follows the same versioning of the external',
54
- is_string: false,
54
+ type: Boolean,
55
55
  default_value: false),
56
56
  ]
57
57
  end
@@ -53,7 +53,7 @@ module Fastlane
53
53
  FastlaneCore::ConfigItem.new(
54
54
  key: :derived_data_path,
55
55
  description: "The path to the DerivedData directory for the project. Should match what's used in the `gym` action",
56
- is_string: true,
56
+ type: String,
57
57
  default_value: '~/Library/Developer/Xcode/DerivedData'
58
58
  ),
59
59
  ]
@@ -43,19 +43,19 @@ module Fastlane
43
43
  key: :version,
44
44
  env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_VERSION',
45
45
  description: 'The version of the hotfix',
46
- is_string: true
46
+ type: String
47
47
  ),
48
48
  FastlaneCore::ConfigItem.new(
49
49
  key: :previous_version,
50
50
  env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_PREVIOUS_VERSION',
51
51
  description: 'The version to branch from',
52
- is_string: true
52
+ type: String
53
53
  ),
54
54
  FastlaneCore::ConfigItem.new(
55
55
  key: :skip_deliver,
56
56
  env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_SKIP_DELIVER',
57
57
  description: 'Skips Deliverfile key update',
58
- is_string: false, # Boolean parameter
58
+ type: Boolean,
59
59
  optional: true,
60
60
  # Don't skip the Deliverfile by default. At the time of writing, 2 out of 3 consumers
61
61
  # still have a Deliverfile.
@@ -39,7 +39,7 @@ module Fastlane
39
39
  FastlaneCore::ConfigItem.new(key: :podfile,
40
40
  env_name: 'FL_IOS_CHECKBETADEPS_PODFILE',
41
41
  description: 'Path to the Podfile to analyse',
42
- is_string: true),
42
+ type: String),
43
43
  ]
44
44
  end
45
45
 
@@ -2,6 +2,8 @@ module Fastlane
2
2
  module Actions
3
3
  class IosClearIntermediateTagsAction < Action
4
4
  def self.run(params)
5
+ return unless UI.confirm("#{deprecated_notes} Would you like to continue with the action?")
6
+
5
7
  UI.message("Deleting tags for version: #{params[:version]}")
6
8
 
7
9
  require_relative '../../helper/git_helper'
@@ -26,11 +28,11 @@ module Fastlane
26
28
  #####################################################
27
29
 
28
30
  def self.description
29
- 'Cleans all the intermediate tags for the given version'
31
+ '(DEPRECATED) Cleans all the intermediate tags for the given version'
30
32
  end
31
33
 
32
34
  def self.details
33
- 'Cleans all the intermediate tags for the given version'
35
+ '(DEPRECATED) Cleans all the intermediate tags for the given version'
34
36
  end
35
37
 
36
38
  def self.available_options
@@ -38,7 +40,7 @@ module Fastlane
38
40
  FastlaneCore::ConfigItem.new(key: :version,
39
41
  env_name: 'FL_IOS_CLEAN_INTERMEDIATE_TAGS_VERSION',
40
42
  description: 'The version of the tags to clear',
41
- is_string: true),
43
+ type: String),
42
44
  ]
43
45
  end
44
46
 
@@ -48,6 +50,16 @@ module Fastlane
48
50
  def self.return_value
49
51
  end
50
52
 
53
+ def self.category
54
+ :deprecated
55
+ end
56
+
57
+ def self.deprecated_notes
58
+ "This action is deprecated as we don't believe it's currently in use in our projects.
59
+ However, just to be sure that it's not in use, we decided to deprecate it first. If you
60
+ believe that this is a mistake, please let us know on Slack."
61
+ end
62
+
51
63
  def self.authors
52
64
  ['Automattic']
53
65
  end
@@ -47,7 +47,7 @@ module Fastlane
47
47
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
48
48
  env_name: 'FL_IOS_CODEFREEZE_PRECHECKS_SKIPCONFIRM',
49
49
  description: 'Skips confirmation before codefreeze',
50
- is_string: false, # true: verifies the input is a string, false: every kind of value
50
+ type: Boolean,
51
51
  default_value: false), # the default value if the user didn't provide one
52
52
  FastlaneCore::ConfigItem.new(key: :default_branch,
53
53
  env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
@@ -6,8 +6,10 @@ module Fastlane
6
6
 
7
7
  require_relative '../../helper/ios/ios_version_helper'
8
8
  require_relative '../../helper/ios/ios_git_helper'
9
+ require_relative '../../helper/git_helper'
9
10
 
10
- UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')
11
+ current_branch = Fastlane::Helper::GitHelper.current_git_branch
12
+ UI.user_error!("Current branch - '#{current_branch}' - is not a release branch. Abort.") unless current_branch.start_with?('release/')
11
13
 
12
14
  version = Fastlane::Helper::Ios::VersionHelper.get_public_version
13
15
  message = "Completing code freeze for: #{version}\n"
@@ -40,7 +42,7 @@ module Fastlane
40
42
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
41
43
  env_name: 'FL_IOS_COMPLETECODEFREEZE_PRECHECKS_SKIPCONFIRM',
42
44
  description: 'Skips confirmation',
43
- is_string: false, # true: verifies the input is a string, false: every kind of value
45
+ type: Boolean,
44
46
  default_value: false), # the default value if the user didn't provide one
45
47
  ]
46
48
  end
@@ -13,7 +13,7 @@ module Fastlane
13
13
  UI.message "Downloading translations for '#{lproj_name}' from GlotPress (#{glotpress_locale}) [#{params[:filters]}]..."
14
14
  lproj_dir = File.join(download_dir, "#{lproj_name}.lproj")
15
15
  destination = File.join(lproj_dir, "#{params[:table_basename]}.strings")
16
- FileUtils.mkdir(lproj_dir) unless Dir.exist?(lproj_dir)
16
+ FileUtils.mkdir_p(lproj_dir)
17
17
 
18
18
  Fastlane::Helper::Ios::L10nHelper.download_glotpress_export_file(
19
19
  project_url: params[:project_url],
@@ -45,10 +45,10 @@ module Fastlane
45
45
  # @return [Hash<String, Array<String>>] The hash listing the keys to extract for each target file
46
46
  #
47
47
  def self.keys_list_per_target_file(original_files)
48
- original_files.map do |original_file|
48
+ original_files.to_h do |original_file|
49
49
  keys = Fastlane::Helper::Ios::L10nHelper.read_strings_file_as_hash(path: original_file).keys
50
50
  [original_file, keys]
51
- end.to_h
51
+ end
52
52
  rescue StandardError => e
53
53
  UI.user_error!("Failed to read the keys to extract from originals file: #{e.message}")
54
54
  end
@@ -2,6 +2,8 @@ module Fastlane
2
2
  module Actions
3
3
  class IosFinalTagAction < Action
4
4
  def self.run(params)
5
+ return unless UI.confirm("#{deprecated_notes} Would you like to continue with the action?")
6
+
5
7
  require_relative '../../helper/ios/ios_git_helper'
6
8
  require_relative '../../helper/ios/ios_version_helper'
7
9
  version = Fastlane::Helper::Ios::VersionHelper.get_public_version
@@ -18,11 +20,11 @@ module Fastlane
18
20
  #####################################################
19
21
 
20
22
  def self.description
21
- 'Finalize a relasae'
23
+ '(DEPRECATED) Finalize a relasae'
22
24
  end
23
25
 
24
26
  def self.details
25
- 'Removes the temp tags and pushes the final one'
27
+ '(DEPRECATED) Removes the temp tags and pushes the final one'
26
28
  end
27
29
 
28
30
  def self.available_options
@@ -30,7 +32,7 @@ module Fastlane
30
32
  FastlaneCore::ConfigItem.new(key: :version,
31
33
  env_name: 'FL_IOS_FINAL_TAG_VERSION',
32
34
  description: 'The version of the release to finalize',
33
- is_string: true),
35
+ type: String),
34
36
  ]
35
37
  end
36
38
 
@@ -40,6 +42,16 @@ module Fastlane
40
42
  def self.return_value
41
43
  end
42
44
 
45
+ def self.category
46
+ :deprecated
47
+ end
48
+
49
+ def self.deprecated_notes
50
+ "This action is deprecated as we don't believe it's currently in use in our projects.
51
+ However, just to be sure that it's not in use, we decided to deprecate it first. If you
52
+ believe that this is a mistake, please let us know on Slack."
53
+ end
54
+
43
55
  def self.authors
44
56
  ['Automattic']
45
57
  end
@@ -6,8 +6,10 @@ module Fastlane
6
6
 
7
7
  require_relative '../../helper/ios/ios_version_helper'
8
8
  require_relative '../../helper/ios/ios_git_helper'
9
+ require_relative '../../helper/git_helper'
9
10
 
10
- UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')
11
+ current_branch = Fastlane::Helper::GitHelper.current_git_branch
12
+ UI.user_error!("Current branch - '#{current_branch}' - is not a release branch. Abort.") unless current_branch.start_with?('release/')
11
13
 
12
14
  version = Fastlane::Helper::Ios::VersionHelper.get_public_version
13
15
  message = "Finalizing release: #{version}\n"
@@ -40,7 +42,7 @@ module Fastlane
40
42
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
41
43
  env_name: 'FL_IOS_FINALIZE_PRECHECKS_SKIPCONFIRM',
42
44
  description: 'Skips confirmation',
43
- is_string: false, # true: verifies the input is a string, false: every kind of value
45
+ type: Boolean,
44
46
  default_value: false), # the default value if the user didn't provide one
45
47
  ]
46
48
  end
@@ -74,12 +74,12 @@ module Fastlane
74
74
  FastlaneCore::ConfigItem.new(key: :quiet,
75
75
  env_name: 'FL_IOS_GENERATE_STRINGS_FILE_FROM_CODE_QUIET',
76
76
  description: 'In quiet mode, `genstrings` will log warnings about duplicate values, but not about duplicate comments',
77
- is_string: false, # Boolean
77
+ type: Boolean,
78
78
  default_value: true),
79
79
  FastlaneCore::ConfigItem.new(key: :swiftui,
80
80
  env_name: 'FL_IOS_GENERATE_STRINGS_FILE_FROM_CODE_SWIFTUI',
81
81
  description: "Should we include SwiftUI's `Text()` when parsing code with `genstrings`",
82
- is_string: false, # Boolean
82
+ type: Boolean,
83
83
  default_value: false),
84
84
  FastlaneCore::ConfigItem.new(key: :output_dir,
85
85
  env_name: 'FL_IOS_GENERATE_STRINGS_FILE_FROM_CODE_OUTPUT_DIR',
@@ -88,7 +88,7 @@ module Fastlane
88
88
  FastlaneCore::ConfigItem.new(key: :fail_on_error,
89
89
  env_name: 'FL_IOS_GENERATE_STRINGS_FILE_FROM_CODE_FAIL_ON_ERROR',
90
90
  description: 'If true, will fail with user_error! if `genstrings` printed any error while parsing',
91
- is_string: false, # Boolean
91
+ type: Boolean,
92
92
  default_value: true),
93
93
  ]
94
94
  end
@@ -0,0 +1,54 @@
1
+ module Fastlane
2
+ module Actions
3
+ class IosGetBuildNumberAction < Action
4
+ def self.run(params)
5
+ require_relative '../../helper/ios/ios_version_helper'
6
+
7
+ xcconfig_file_path = params[:xcconfig_file_path]
8
+ Fastlane::Helper::Ios::VersionHelper.read_build_number_from_config_file(xcconfig_file_path)
9
+ end
10
+
11
+ #####################################################
12
+ # @!group Documentation
13
+ #####################################################
14
+
15
+ def self.description
16
+ 'Gets the build number of the app'
17
+ end
18
+
19
+ def self.details
20
+ 'Gets the build number of the app'
21
+ end
22
+
23
+ def self.available_options
24
+ [
25
+ FastlaneCore::ConfigItem.new(
26
+ key: :xcconfig_file_path,
27
+ env_name: 'FL_IOS_XCCONFIG_FILE_PATH',
28
+ description: 'Path to the .xcconfig file containing the build number',
29
+ type: String,
30
+ optional: false
31
+ ),
32
+ ]
33
+ end
34
+
35
+ def self.output
36
+ # Define the shared values you are going to provide
37
+ end
38
+
39
+ def self.return_value
40
+ # If you method provides a return value, you can describe here what it does
41
+ 'Return the build number of the app'
42
+ end
43
+
44
+ def self.authors
45
+ # So no one will ever forget your contribution to fastlane :) You are awesome btw!
46
+ ['Automattic']
47
+ end
48
+
49
+ def self.is_supported?(platform)
50
+ [:ios, :mac].include?(platform)
51
+ end
52
+ end
53
+ end
54
+ end
@@ -32,7 +32,7 @@ module Fastlane
32
32
  key: :internal,
33
33
  env_name: 'FL_IOS_BUILD_VERSION_INTERNAL',
34
34
  description: 'If true, returns the internal build version, otherwise returns the public one',
35
- is_string: false, # Boolean
35
+ type: Boolean,
36
36
  default_value: false
37
37
  ),
38
38
  ]
@@ -51,11 +51,11 @@ module Fastlane
51
51
  FastlaneCore::ConfigItem.new(key: :version,
52
52
  env_name: 'FL_IOS_HOTFIX_PRECHECKS_VERSION',
53
53
  description: 'The version to work on', # a short description of this parameter
54
- is_string: true),
54
+ type: String),
55
55
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
56
56
  env_name: 'FL_IOS_HOTFIX_PRECHECKS_SKIPCONFIRM',
57
57
  description: 'Skips confirmation',
58
- is_string: false, # true: verifies the input is a string, false: every kind of value
58
+ type: Boolean,
59
59
  default_value: false), # the default value if the user didn't provide one
60
60
  ]
61
61
  end
@@ -163,7 +163,7 @@ module Fastlane
163
163
  description: 'Should we abort the rest of the lane with a global error if any violations are found?',
164
164
  optional: true,
165
165
  default_value: true,
166
- is_string: false # https://docs.fastlane.tools/advanced/actions/#boolean-parameters
166
+ type: Boolean
167
167
  ),
168
168
  FastlaneCore::ConfigItem.new(
169
169
  key: :allow_retry,
@@ -171,7 +171,7 @@ module Fastlane
171
171
  description: 'If any violations are found, show an interactive prompt allowing the user to manually fix the issues locally and retry the linting',
172
172
  optional: true,
173
173
  default_value: false,
174
- is_string: false # https://docs.fastlane.tools/advanced/actions/#boolean-parameters
174
+ type: Boolean
175
175
  ),
176
176
  FastlaneCore::ConfigItem.new(
177
177
  key: :check_duplicate_keys,
@@ -179,7 +179,7 @@ module Fastlane
179
179
  description: 'Checks the input files for duplicate keys',
180
180
  optional: true,
181
181
  default_value: true,
182
- is_string: false # https://docs.fastlane.tools/advanced/actions/#boolean-parameters
182
+ type: Boolean
183
183
  ),
184
184
  ]
185
185
  end
@@ -42,7 +42,7 @@ module Fastlane
42
42
  FastlaneCore::ConfigItem.new(key: :po_file_path,
43
43
  env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_PO_FILE_PATH',
44
44
  description: 'The path of the .po file to update',
45
- is_string: true,
45
+ type: String,
46
46
  verify_block: proc do |value|
47
47
  UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && (!value.empty?)
48
48
  UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
@@ -56,7 +56,7 @@ module Fastlane
56
56
  FastlaneCore::ConfigItem.new(key: :source_files,
57
57
  env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_SOURCE_FILES',
58
58
  description: 'The hash with the path to the source files and the key to use to include their content',
59
- is_string: false,
59
+ type: Hash,
60
60
  verify_block: proc do |value|
61
61
  UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && (!value.empty?)
62
62
  end),
@@ -34,11 +34,11 @@ module Fastlane
34
34
  FastlaneCore::ConfigItem.new(key: :new_version,
35
35
  env_name: 'FL_IOS_UPDATE_RELEASE_NOTES_VERSION',
36
36
  description: 'The version we are currently freezing; An empty entry for the _next_ version after this one will be added to the release notes',
37
- is_string: true),
37
+ type: String),
38
38
  FastlaneCore::ConfigItem.new(key: :release_notes_file_path,
39
39
  env_name: 'FL_IOS_UPDATE_RELEASE_NOTES_FILE_PATH',
40
40
  description: 'The path to the release notes file to be updated',
41
- is_string: true,
41
+ type: String,
42
42
  default_value: File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')),
43
43
  ]
44
44
  end
@@ -50,7 +50,7 @@ module Fastlane
50
50
 
51
51
  if line_count <= 1
52
52
  # Single line output
53
- fw.puts("msgid \"#{File.open(@content_file_path, 'r').read.rstrip}\"")
53
+ fw.puts("msgid \"#{File.read(@content_file_path).rstrip}\"")
54
54
  else
55
55
  # Multiple line output
56
56
  fw.puts('msgid ""')
@@ -145,7 +145,7 @@ module Fastlane
145
145
  end
146
146
 
147
147
  def generate_block(fw)
148
- super(fw) unless File.zero?(@content_file_path)
148
+ super(fw) unless File.empty?(@content_file_path)
149
149
  end
150
150
  end
151
151
  end
@@ -240,7 +240,7 @@ module Fastlane
240
240
  attributes_to_copy = %w[formatted] # Attributes that we want to replicate into translated `string.xml` files
241
241
  orig_file = File.join(res_dir, 'values', 'strings.xml')
242
242
  orig_xml = File.open(orig_file) { |f| Nokogiri::XML(f, nil, Encoding::UTF_8.to_s) }
243
- orig_attributes = orig_xml.xpath('//string').map { |tag| [tag['name'], tag.attributes.select { |k, _| attributes_to_copy.include?(k) }] }.to_h
243
+ orig_attributes = orig_xml.xpath('//string').to_h { |tag| [tag['name'], tag.attributes.select { |k, _| attributes_to_copy.include?(k) }] }
244
244
 
245
245
  locales_map.each do |lang_codes|
246
246
  all_xml_documents = glotpress_filters.map do |filters|
@@ -262,7 +262,7 @@ module Fastlane
262
262
 
263
263
  # Save
264
264
  lang_dir = File.join(res_dir, "values-#{lang_codes[:android]}")
265
- FileUtils.mkdir(lang_dir) unless Dir.exist?(lang_dir)
265
+ FileUtils.mkdir_p(lang_dir)
266
266
  lang_file = File.join(lang_dir, 'strings.xml')
267
267
  File.open(lang_file, 'w') { |f| merged_xml.write_to(f, encoding: Encoding::UTF_8.to_s, indent: 4) }
268
268
  end
@@ -465,8 +465,8 @@ module Fastlane
465
465
  # @return [String] The path of the `build.gradle` file inside the project subfolder in the project's repo
466
466
  #
467
467
  def self.gradle_path
468
- UI.user_error!("You need to set the \`PROJECT_ROOT_FOLDER\` environment variable to the path to the project's root") if ENV['PROJECT_ROOT_FOLDER'].nil?
469
- UI.user_error!("You need to set the \`PROJECT_NAME\` environment variable to the relative path to the project subfolder name") if ENV['PROJECT_NAME'].nil?
468
+ UI.user_error!("You need to set the `PROJECT_ROOT_FOLDER` environment variable to the path to the project's root") if ENV['PROJECT_ROOT_FOLDER'].nil?
469
+ UI.user_error!('You need to set the `PROJECT_NAME` environment variable to the relative path to the project subfolder name') if ENV['PROJECT_NAME'].nil?
470
470
  File.join(ENV['PROJECT_ROOT_FOLDER'], ENV['PROJECT_NAME'], 'build.gradle')
471
471
  end
472
472
 
@@ -181,6 +181,23 @@ module Fastlane
181
181
  Action.sh('git', 'fetch', '--tags')
182
182
  end
183
183
 
184
+ # Returns the current git branch, or "HEAD" if it's not checked out to any branch
185
+ # Can NOT be replaced using the environment variables such as `GIT_BRANCH` or `BUILDKITE_BRANCH`
186
+ #
187
+ # `fastlane` already has a helper action for this called `git_branch`, however it's modified
188
+ # by CI environment variables. We need to check which branch we are actually on and not the
189
+ # initial branch a CI build is started from, so we are using the `git_branch_name_using_HEAD`
190
+ # helper instead.
191
+ #
192
+ # See https://docs.fastlane.tools/actions/git_branch/#git_branch
193
+ #
194
+ # @return [String] The current git branch, or "HEAD" if it's not checked out to any branch
195
+ #
196
+ def self.current_git_branch
197
+ # We can't use `other_action.git_branch`, because it is modified by environment variables in Buildkite.
198
+ Fastlane::Actions.git_branch_name_using_HEAD
199
+ end
200
+
184
201
  # Checks if a branch exists locally.
185
202
  #
186
203
  # @param [String] branch_name The name of the branch to check for
@@ -66,7 +66,7 @@ module Fastlane
66
66
  # @return [Integer] The percentage of the translated strings.
67
67
  #
68
68
  def self.extract_value_from_translation_info_data(data:, language_code:, status:)
69
- regex = "\/#{language_code}\/.*#{status}.*>([0-9,]+)"
69
+ regex = "/#{language_code}/.*#{status}.*>([0-9,]+)"
70
70
 
71
71
  # 1. Grep the line with contains the required info.
72
72
  # 2. Match the info and extract the value in group 1.
@@ -48,7 +48,7 @@ module Fastlane
48
48
  extracted_dir = File.join(tmpdir, "swiftgen-#{version}")
49
49
  Action.sh('unzip', zipfile, '-d', extracted_dir)
50
50
 
51
- FileUtils.rm_rf(install_path) if File.exist?(install_path)
51
+ FileUtils.rm_rf(install_path)
52
52
  FileUtils.mkdir_p(install_path)
53
53
  FileUtils.cp_r("#{extracted_dir}/.", install_path)
54
54
  end
@@ -79,7 +79,7 @@ module Fastlane
79
79
  file_path = get_target_file_path(locale, file_name)
80
80
 
81
81
  dir_path = File.dirname(file_path)
82
- FileUtils.mkdir_p(dir_path) unless File.exist?(dir_path)
82
+ FileUtils.mkdir_p(dir_path)
83
83
 
84
84
  File.open(file_path, 'w') { |file| file.puts(content) }
85
85
  end
@@ -88,7 +88,7 @@ module Fastlane
88
88
  def delete_existing_metadata(target_locale)
89
89
  @target_files.each do |file|
90
90
  file_path = get_target_file_path(target_locale, file[1][:desc])
91
- File.delete(file_path) if File.exist? file_path
91
+ FileUtils.rm_f(file_path)
92
92
  end
93
93
  end
94
94
 
@@ -50,7 +50,7 @@ module Fastlane
50
50
 
51
51
  if line_count <= 1
52
52
  # Single line output
53
- fw.puts("msgid \"#{File.open(@content_file_path, 'r').read}\"")
53
+ fw.puts("msgid \"#{File.read(@content_file_path)}\"")
54
54
  else
55
55
  # Multiple line output
56
56
  fw.puts('msgid ""')
@@ -24,7 +24,7 @@ module Fastlane
24
24
  if $skip_magick
25
25
  message = "PromoScreenshots feature is currently disabled.\n"
26
26
  message << "Please, install RMagick if you aim to generate the PromoScreenshots.\n"
27
- message << "\'bundle install --with screenshots\' should do it if your project is configured for PromoScreenshots.\n"
27
+ message << "'bundle install --with screenshots' should do it if your project is configured for PromoScreenshots.\n"
28
28
  message << 'Aborting.'
29
29
  UI.user_error!(message)
30
30
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Wpmreleasetoolkit
3
- VERSION = '7.0.0'
3
+ VERSION = '7.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-wpmreleasetoolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Automattic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-16 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '4.18'
103
+ version: '5.6'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '4.18'
110
+ version: '5.6'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: parallel
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -450,6 +450,7 @@ files:
450
450
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb
451
451
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb
452
452
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb
453
+ - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_number.rb
453
454
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb
454
455
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb
455
456
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb