fastlane-plugin-wpmreleasetoolkit 4.1.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_localize_libs_action.rb +1 -1
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +1 -1
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +1 -1
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +1 -1
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +1 -1
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_preflight.rb +1 -1
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +1 -1
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +1 -1
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +1 -1
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +1 -1
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +1 -1
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +1 -1
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +1 -1
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +1 -1
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +1 -1
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +1 -1
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +187 -0
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +1 -1
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +1 -1
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +1 -1
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/{android_hotifx_prechecks.rb → android_hotfix_prechecks.rb} +1 -1
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb +279 -0
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +1 -1
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +1 -1
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +1 -1
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_for_toolkit_updates_action.rb +1 -1
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +1 -1
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb +1 -1
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb +1 -1
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +1 -1
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +1 -1
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +1 -1
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/firebase_login.rb +44 -0
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +1 -1
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +1 -1
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +1 -2
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +1 -1
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/removebranchprotection_action.rb +1 -1
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setbranchprotection_action.rb +1 -1
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +1 -1
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +1 -1
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_apply_action.rb +1 -1
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb +1 -1
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb +1 -1
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +1 -1
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +1 -1
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +1 -1
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +1 -1
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +1 -1
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +1 -1
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +1 -1
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +1 -1
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +1 -1
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +1 -1
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +1 -1
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +1 -1
  59. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
  60. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +1 -1
  61. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb +1 -1
  62. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +1 -1
  63. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +1 -1
  64. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +1 -1
  65. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +1 -1
  66. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +1 -1
  67. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/{ios_hotifx_prechecks.rb → ios_hotfix_prechecks.rb} +1 -1
  68. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +45 -6
  69. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +1 -1
  70. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_strings_files.rb +1 -1
  71. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb +170 -0
  72. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +1 -1
  73. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +1 -1
  74. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +1 -1
  75. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +1 -1
  76. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +1 -1
  77. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +6 -2
  78. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb +95 -0
  79. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb +7 -3
  80. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +4 -4
  81. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +1 -1
  82. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/user_agent.rb +5 -0
  83. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_account.rb +19 -0
  84. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_device.rb +62 -0
  85. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_lab_result.rb +36 -0
  86. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb +104 -0
  87. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  88. data/lib/fastlane/plugin/wpmreleasetoolkit.rb +2 -2
  89. metadata +121 -83
@@ -0,0 +1,279 @@
1
+ require_relative '../../helper/app_size_metrics_helper'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class AndroidSendAppSizeMetricsAction < Action
6
+ # Keys used by the metrics payload
7
+ AAB_FILE_SIZE_KEY = 'AAB File Size'.freeze # value from `File.size` of the `.aab`
8
+ UNIVERSAL_APK_FILE_SIZE_KEY = 'Universal APK File Size'.freeze # value from `File.size` of the Universal `.apk`
9
+ UNIVERSAL_APK_SPLIT_NAME = 'Universal'.freeze # pseudo-name of the split representing the Universal `.apk`
10
+ APK_OPTIMIZED_FILE_SIZE_KEY = 'Optimized APK File Size'.freeze # value from `apkanalyzer apk file-size`
11
+ APK_OPTIMIZED_DOWNLOAD_SIZE_KEY = 'Download Size'.freeze # value from `apkanalyzer apk download-size`
12
+
13
+ def self.run(params)
14
+ # Check input parameters
15
+ api_url = URI(params[:api_url])
16
+ api_token = params[:api_token]
17
+ if (api_token.nil? || api_token.empty?) && !api_url.is_a?(URI::File)
18
+ UI.user_error!('An API token is required when using an `api_url` with a scheme other than `file://`')
19
+ end
20
+ if params[:aab_path].nil? && params[:universal_apk_path].nil?
21
+ UI.user_error!('You must provide at least an `aab_path` or an `universal_apk_path`, or both')
22
+ end
23
+
24
+ # Build the payload base
25
+ metrics_helper = Fastlane::Helper::AppSizeMetricsHelper.new(
26
+ Platform: 'Android',
27
+ 'App Name': params[:app_name],
28
+ 'App Version': params[:app_version_name],
29
+ 'Version Code': params[:app_version_code],
30
+ 'Product Flavor': params[:product_flavor],
31
+ 'Build Type': params[:build_type],
32
+ Source: params[:source]
33
+ )
34
+ # Add AAB file size
35
+ metrics_helper.add_metric(name: AAB_FILE_SIZE_KEY, value: File.size(params[:aab_path])) unless params[:aab_path].nil?
36
+ # Add Universal APK file size
37
+ metrics_helper.add_metric(name: UNIVERSAL_APK_FILE_SIZE_KEY, value: File.size(params[:universal_apk_path])) unless params[:universal_apk_path].nil?
38
+
39
+ # Add optimized file and download sizes for each split `.apk` metrics to the payload if a `:include_split_sizes` is enabled
40
+ if params[:include_split_sizes]
41
+ apkanalyzer_bin = params[:apkanalyzer_binary] || find_apkanalyzer_binary!
42
+ unless params[:aab_path].nil?
43
+ generate_split_apks(aab_path: params[:aab_path]) do |apk|
44
+ split_name = File.basename(apk, '.apk')
45
+ add_apk_size_metrics(helper: metrics_helper, apkanalyzer_bin: apkanalyzer_bin, apk: apk, split_name: split_name)
46
+ end
47
+ end
48
+ unless params[:universal_apk_path].nil?
49
+ add_apk_size_metrics(helper: metrics_helper, apkanalyzer_bin: apkanalyzer_bin, apk: params[:universal_apk_path], split_name: UNIVERSAL_APK_SPLIT_NAME)
50
+ end
51
+ end
52
+
53
+ # Send the payload
54
+ metrics_helper.send_metrics(
55
+ to: api_url,
56
+ api_token: api_token,
57
+ use_gzip: params[:use_gzip_content_encoding]
58
+ )
59
+ end
60
+
61
+ #####################################################
62
+ # @!group Small helper methods
63
+ #####################################################
64
+ class << self
65
+ # @raise if `bundletool` can not be found in `$PATH`
66
+ def check_bundletool_installed!
67
+ Action.sh('command', '-v', 'bundletool', print_command: false, print_command_output: false)
68
+ rescue StandardError
69
+ UI.user_error!('`bundletool` is required to build the split APKs. Install it with `brew install bundletool`')
70
+ raise
71
+ end
72
+
73
+ # The path where the `apkanalyzer` binary was found, after searching it:
74
+ # - in priority in `$ANDROID_SDK_ROOT` (or `$ANDROID_HOME` for legacy setups), under `cmdline-tools/latest/bin/` or `cmdline-tools/tools/bin`
75
+ # - and falling back by trying to find it in `$PATH`
76
+ #
77
+ # @return [String,Nil] The path to `apkanalyzer`, or `nil` if it wasn't found in any of the above tested paths.
78
+ #
79
+ def find_apkanalyzer_binary
80
+ sdk_root = ENV['ANDROID_SDK_ROOT'] || ENV['ANDROID_HOME']
81
+ if sdk_root
82
+ pattern = File.join(sdk_root, 'cmdline-tools', '{latest,tools}', 'bin', 'apkanalyzer')
83
+ apkanalyzer_bin = Dir.glob(pattern).find { |path| File.executable?(path) }
84
+ end
85
+ apkanalyzer_bin || Action.sh('command', '-v', 'apkanalyzer', print_command_output: false) { |_| nil }
86
+ end
87
+
88
+ # The path where the `apkanalyzer` binary was found, after searching it:
89
+ # - in priority in `$ANDROID_SDK_ROOT` (or `$ANDROID_HOME` for legacy setups), under `cmdline-tools/latest/bin/` or `cmdline-tools/tools/bin`
90
+ # - and falling back by trying to find it in `$PATH`
91
+ #
92
+ # @return [String] The path to `apkanalyzer`
93
+ # @raise [FastlaneCore::Interface::FastlaneError] if it wasn't found in any of the above tested paths.
94
+ #
95
+ def find_apkanalyzer_binary!
96
+ apkanalyzer_bin = find_apkanalyzer_binary
97
+ UI.user_error!('Unable to find `apkanalyzer` executable in either `$PATH` or `$ANDROID_SDK_ROOT`. Make sure you installed the Android SDK Command-line Tools') if apkanalyzer_bin.nil?
98
+ apkanalyzer_bin
99
+ end
100
+
101
+ # Add the `file-size` and `download-size` values of an APK to the helper, as reported by the corresponding `apkanalyzer apk …` commands
102
+ #
103
+ # @param [Fastlane::Helper::AppSizeMetricsHelper] helper The helper to add the metrics to
104
+ # @param [String] apkanalyzer_bin The path to the `apkanalyzer` binary to use to extract those file and download sizes from the `.apk`
105
+ # @param [String] apk The path to the `.apk` file to extract the sizes from
106
+ # @param [String] split_name The name to use for the value of the `split` metadata key in the metrics being added
107
+ #
108
+ def add_apk_size_metrics(helper:, apkanalyzer_bin:, apk:, split_name:)
109
+ UI.message("[App Size Metrics] Computing file and download size of #{File.basename(apk)}...")
110
+ file_size = Action.sh(apkanalyzer_bin, 'apk', 'file-size', apk, print_command: false, print_command_output: false).chomp.to_i
111
+ download_size = Action.sh(apkanalyzer_bin, 'apk', 'download-size', apk, print_command: false, print_command_output: false).chomp.to_i
112
+ helper.add_metric(name: APK_OPTIMIZED_FILE_SIZE_KEY, value: file_size, metadata: { split: split_name })
113
+ helper.add_metric(name: APK_OPTIMIZED_DOWNLOAD_SIZE_KEY, value: download_size, metadata: { split: split_name })
114
+ end
115
+
116
+ # Generates all the split `.apk` files (typically one per device architecture) from a given `.aab` file, then yield for each apk produced.
117
+ #
118
+ # @note The split `.apk` files are generated in a temporary directory and are thus all deleted after each of them has been `yield`ed to the provided block.
119
+ # @param [String] aab_path The path to the `.aab` file to generate split `.apk` files for
120
+ # @yield [apk] Calls the provided block once for each split `.apk` that was generated from the `.aab`
121
+ # @yieldparam apk [String] The path to one of the split `.apk` temporary file generated from the `.aab`
122
+ #
123
+ def generate_split_apks(aab_path:, &block)
124
+ check_bundletool_installed!
125
+ UI.message("[App Size Metrics] Generating the various APK splits from #{aab_path}...")
126
+ Dir.mktmpdir('release-toolkit-android-app-size-metrics') do |tmp_dir|
127
+ Action.sh('bundletool', 'build-apks', '--bundle', aab_path, '--output-format', 'DIRECTORY', '--output', tmp_dir)
128
+ apks = Dir.glob('splits/*.apk', base: tmp_dir).map { |f| File.join(tmp_dir, f) }
129
+ UI.message("[App Size Metrics] Generated #{apks.length} APKs.")
130
+ apks.each(&block)
131
+ UI.message('[App Size Metrics] Done computing splits sizes.')
132
+ end
133
+ end
134
+ end
135
+
136
+ #####################################################
137
+ # @!group Documentation
138
+ #####################################################
139
+
140
+ def self.description
141
+ 'Send Android app size metrics to our metrics server'
142
+ end
143
+
144
+ def self.details
145
+ <<~DETAILS
146
+ Send Android app size metrics to our metrics server.
147
+
148
+ See https://github.com/Automattic/apps-metrics for the API contract expected by the Metrics server you will send those metrics to.
149
+
150
+ Tip: If you provide a `file://` URL for the `api_url`, the action will write the payload on disk at the specified path instead of sending
151
+ the data to a endpoint over network. This can be useful e.g. to inspect the payload and debug it, or to store the metrics data as CI artefacts.
152
+ DETAILS
153
+ end
154
+
155
+ def self.available_options
156
+ [
157
+ FastlaneCore::ConfigItem.new(
158
+ key: :api_url,
159
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_API_URL',
160
+ description: 'The endpoint API URL to publish metrics to. (Note: you can also point to a `file://` URL to write the payload to a file instead)',
161
+ type: String,
162
+ optional: false
163
+ ),
164
+ FastlaneCore::ConfigItem.new(
165
+ key: :api_token,
166
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_API_TOKEN',
167
+ description: 'The bearer token to call the API. Required, unless `api_url` is a `file://` URL',
168
+ type: String,
169
+ optional: true
170
+ ),
171
+ FastlaneCore::ConfigItem.new(
172
+ key: :use_gzip_content_encoding,
173
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_USE_GZIP_CONTENT_ENCODING',
174
+ description: 'Specify that we should use `Content-Encoding: gzip` and gzip the body when sending the request',
175
+ type: FastlaneCore::Boolean,
176
+ default_value: true
177
+ ),
178
+ FastlaneCore::ConfigItem.new(
179
+ key: :app_name,
180
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_APP_NAME',
181
+ description: 'The name of the app for which we are publishing metrics, to help filter by app in the dashboard',
182
+ type: String,
183
+ optional: false
184
+ ),
185
+ FastlaneCore::ConfigItem.new(
186
+ key: :app_version_name,
187
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_APP_VERSION_NAME',
188
+ description: 'The version name of the app for which we are publishing metrics, to help filter by version in the dashboard',
189
+ type: String,
190
+ optional: false
191
+ ),
192
+ FastlaneCore::ConfigItem.new(
193
+ key: :app_version_code,
194
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_APP_VERSION_CODE',
195
+ description: 'The version code of the app for which we are publishing metrics, to help filter by version in the dashboard',
196
+ type: Integer,
197
+ optional: true
198
+ ),
199
+ FastlaneCore::ConfigItem.new(
200
+ key: :product_flavor,
201
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_PRODUCT_FLAVOR',
202
+ description: 'The product flavor for which we are publishing metrics, to help filter by flavor in the dashboard. E.g. `Vanilla`, `Jalapeno`, `Wasabi`',
203
+ type: String,
204
+ optional: true
205
+ ),
206
+ FastlaneCore::ConfigItem.new(
207
+ key: :build_type,
208
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_BUILD_TYPE',
209
+ description: 'The build type for which we are publishing metrics, to help filter by build type in the dashboard. E.g. `Debug`, `Release`',
210
+ type: String,
211
+ optional: true
212
+ ),
213
+ FastlaneCore::ConfigItem.new(
214
+ key: :source,
215
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_SOURCE',
216
+ description: 'The type of event at the origin of that build, to help filter data in the dashboard. E.g. `pr`, `beta`, `final-release`',
217
+ type: String,
218
+ optional: true
219
+ ),
220
+ FastlaneCore::ConfigItem.new(
221
+ key: :aab_path,
222
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_AAB_PATH',
223
+ description: 'The path to the .aab to extract size information from',
224
+ type: String,
225
+ optional: true, # We can have `aab_path` only, or `universal_apk_path` only, or both (but not none)
226
+ verify_block: proc do |value|
227
+ UI.user_error!('You must provide an path to an existing `.aab` file') unless File.exist?(value)
228
+ end
229
+ ),
230
+ FastlaneCore::ConfigItem.new(
231
+ key: :include_split_sizes,
232
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_INCLUDE_SPLIT_SIZES',
233
+ description: 'Indicate if we should use `bundletool` and `apkanalyzer` to also compute and send "split apk" sizes per architecture. ' \
234
+ + 'Setting this to `true` adds a bit of extra time to generate the `.apk` and extract the data, but provides more detailed metrics',
235
+ type: FastlaneCore::Boolean,
236
+ default_value: true
237
+ ),
238
+ FastlaneCore::ConfigItem.new(
239
+ key: :universal_apk_path,
240
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_UNIVERSAL_APK_PATH',
241
+ description: 'The path to the Universal `.apk` to extract size information from',
242
+ type: String,
243
+ optional: true, # We can have `aab_path` only, or `universal_apk_path` only, or both (but not none)
244
+ verify_block: proc do |value|
245
+ UI.user_error!('You must provide a path to an existing `.apk` file') unless File.exist?(value)
246
+ end
247
+ ),
248
+ FastlaneCore::ConfigItem.new(
249
+ key: :apkanalyzer_binary,
250
+ env_name: 'FL_ANDROID_SEND_APP_SIZE_METRICS_APKANALYZER_BINARY',
251
+ description: 'The path to the `apkanalyzer` binary to use. If not provided explicitly, we will use `$PATH` and `$ANDROID_SDK_HOME` to try to find it',
252
+ type: String,
253
+ default_value: find_apkanalyzer_binary,
254
+ default_value_dynamic: true,
255
+ verify_block: proc do |value|
256
+ UI.user_error!('You must provide a path to an existing executable for `apkanalyzer`') unless File.executable?(value)
257
+ end
258
+ ),
259
+ ]
260
+ end
261
+
262
+ def self.return_type
263
+ :integer
264
+ end
265
+
266
+ def self.return_value
267
+ 'The HTTP return code from the call. Expect a 201 when new metrics were received successfully and entries created in the database'
268
+ end
269
+
270
+ def self.authors
271
+ ['Automattic']
272
+ end
273
+
274
+ def self.is_supported?(platform)
275
+ platform == :android
276
+ end
277
+ end
278
+ end
279
+ end
@@ -40,7 +40,7 @@ module Fastlane
40
40
  end
41
41
 
42
42
  def self.authors
43
- ['loremattei']
43
+ ['Automattic']
44
44
  end
45
45
 
46
46
  def self.is_supported?(platform)
@@ -45,7 +45,7 @@ module Fastlane
45
45
  end
46
46
 
47
47
  def self.authors
48
- ['loremattei']
48
+ ['Automattic']
49
49
  end
50
50
 
51
51
  def self.is_supported?(platform)
@@ -36,7 +36,7 @@ module Fastlane
36
36
  [
37
37
  FastlaneCore::ConfigItem.new(
38
38
  key: :buildkite_token,
39
- env_name: 'BUILDKITE_TOKEN',
39
+ env_names: %w[BUILDKITE_TOKEN BUILDKITE_API_TOKEN],
40
40
  description: 'Buildkite Personal Access Token',
41
41
  type: String,
42
42
  sensitive: true
@@ -60,7 +60,7 @@ module Fastlane
60
60
  end
61
61
 
62
62
  def self.authors
63
- ['Olivier Halligon']
63
+ ['Automattic']
64
64
  end
65
65
 
66
66
  def self.return_value
@@ -136,7 +136,7 @@ module Fastlane
136
136
  end
137
137
 
138
138
  def self.authors
139
- ['loremattei']
139
+ ['Automattic']
140
140
  end
141
141
 
142
142
  def self.is_supported?(platform)
@@ -52,7 +52,7 @@ module Fastlane
52
52
  end
53
53
 
54
54
  def self.authors
55
- ['loremattei']
55
+ ['Automattic']
56
56
  end
57
57
 
58
58
  def self.is_supported?(platform)
@@ -21,7 +21,7 @@ module Fastlane
21
21
  end
22
22
 
23
23
  def self.authors
24
- ['Lorenzo Mattei']
24
+ ['Automattic']
25
25
  end
26
26
 
27
27
  def self.return_value
@@ -23,7 +23,7 @@ module Fastlane
23
23
  end
24
24
 
25
25
  def self.authors
26
- ['Lorenzo Mattei']
26
+ ['Automattic']
27
27
  end
28
28
 
29
29
  def self.return_value
@@ -37,7 +37,7 @@ module Fastlane
37
37
  end
38
38
 
39
39
  def self.authors
40
- ['Lorenzo Mattei']
40
+ ['Automattic']
41
41
  end
42
42
 
43
43
  def self.return_value
@@ -49,7 +49,7 @@ module Fastlane
49
49
  end
50
50
 
51
51
  def self.authors
52
- ['Lorenzo Mattei']
52
+ ['Automattic']
53
53
  end
54
54
 
55
55
  def self.return_value
@@ -0,0 +1,44 @@
1
+ require 'securerandom'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class FirebaseLoginAction < Action
6
+ def self.run(params)
7
+ Fastlane::FirebaseAccount.activate_service_account_with_key_file(params[:key_file])
8
+ end
9
+
10
+ #####################################################
11
+ # @!group Documentation
12
+ #####################################################
13
+ def self.description
14
+ 'Logs the local machine into Google Cloud using the provided key file'
15
+ end
16
+
17
+ def self.details
18
+ description
19
+ end
20
+
21
+ def self.available_options
22
+ [
23
+ FastlaneCore::ConfigItem.new(
24
+ key: :key_file,
25
+ description: 'The key file used to authorize with Google Cloud',
26
+ type: String,
27
+ verify_block: proc do |value|
28
+ UI.user_error!('The `:key_file` parameter is required') if value.empty?
29
+ UI.user_error!("No Google Cloud Key file found at: #{value}") unless File.exist?(value)
30
+ end
31
+ ),
32
+ ]
33
+ end
34
+
35
+ def self.authors
36
+ ['Automattic']
37
+ end
38
+
39
+ def self.is_supported?(platform)
40
+ true
41
+ end
42
+ end
43
+ end
44
+ end
@@ -26,7 +26,7 @@ module Fastlane
26
26
  end
27
27
 
28
28
  def self.authors
29
- ['Lorenzo Mattei']
29
+ ['Automattic']
30
30
  end
31
31
 
32
32
  def self.return_value
@@ -79,7 +79,7 @@ module Fastlane
79
79
  end
80
80
 
81
81
  def self.authors
82
- ['loremattei']
82
+ ['Automattic']
83
83
  end
84
84
 
85
85
  def self.is_supported?(platform)
@@ -1,4 +1,3 @@
1
- require 'fastlane/action'
2
1
  require_relative '../../helper/metadata_update_helper'
3
2
 
4
3
  module Fastlane
@@ -160,7 +159,7 @@ module Fastlane
160
159
  end
161
160
 
162
161
  def self.authors
163
- ['loremattei']
162
+ ['Automattic']
164
163
  end
165
164
 
166
165
  def self.is_supported?(platform)
@@ -123,7 +123,7 @@ module Fastlane
123
123
  end
124
124
 
125
125
  def self.authors
126
- ['Lorenzo Mattei']
126
+ ['Automattic']
127
127
  end
128
128
 
129
129
  def self.return_value
@@ -22,7 +22,7 @@ module Fastlane
22
22
  end
23
23
 
24
24
  def self.authors
25
- ['Lorenzo Mattei']
25
+ ['Automattic']
26
26
  end
27
27
 
28
28
  def self.return_value
@@ -21,7 +21,7 @@ module Fastlane
21
21
  end
22
22
 
23
23
  def self.authors
24
- ['Lorenzo Mattei']
24
+ ['Automattic']
25
25
  end
26
26
 
27
27
  def self.return_value
@@ -41,7 +41,7 @@ module Fastlane
41
41
  end
42
42
 
43
43
  def self.authors
44
- ['Lorenzo Mattei']
44
+ ['Automattic']
45
45
  end
46
46
 
47
47
  def self.return_value
@@ -73,7 +73,7 @@ module Fastlane
73
73
  end
74
74
 
75
75
  def self.authors
76
- ['Jeremy Massel']
76
+ ['Automattic']
77
77
  end
78
78
 
79
79
  def self.return_value
@@ -113,7 +113,7 @@ module Fastlane
113
113
  end
114
114
 
115
115
  def self.authors
116
- ['Jeremy Massel']
116
+ ['Automattic']
117
117
  end
118
118
 
119
119
  def self.details
@@ -33,7 +33,7 @@ module Fastlane
33
33
  end
34
34
 
35
35
  def self.authors
36
- ['Jeremy Massel']
36
+ ['Automattic']
37
37
  end
38
38
 
39
39
  def self.return_value
@@ -63,7 +63,7 @@ module Fastlane
63
63
  end
64
64
 
65
65
  def self.authors
66
- ['Jeremy Massel']
66
+ ['Automattic']
67
67
  end
68
68
 
69
69
  def self.return_value
@@ -124,7 +124,7 @@ module Fastlane
124
124
  end
125
125
 
126
126
  def self.authors
127
- ['Jeremy Massel']
127
+ ['Automattic']
128
128
  end
129
129
 
130
130
  def self.details
@@ -119,7 +119,7 @@ module Fastlane
119
119
  end
120
120
 
121
121
  def self.authors
122
- ['Jeremy Massel']
122
+ ['Automattic']
123
123
  end
124
124
 
125
125
  def self.details
@@ -66,7 +66,7 @@ module Fastlane
66
66
 
67
67
  def self.authors
68
68
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
69
- ['jkmassel']
69
+ ['Automattic']
70
70
  end
71
71
 
72
72
  def self.is_supported?(platform)
@@ -68,7 +68,7 @@ module Fastlane
68
68
 
69
69
  def self.authors
70
70
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
71
- ['jkmassel']
71
+ ['Automattic']
72
72
  end
73
73
 
74
74
  def self.is_supported?(platform)
@@ -87,7 +87,7 @@ module Fastlane
87
87
 
88
88
  def self.authors
89
89
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
90
- ['loremattei']
90
+ ['Automattic']
91
91
  end
92
92
 
93
93
  def self.is_supported?(platform)
@@ -63,7 +63,7 @@ module Fastlane
63
63
  end
64
64
 
65
65
  def self.authors
66
- ['loremattei']
66
+ ['Automattic']
67
67
  end
68
68
 
69
69
  def self.is_supported?(platform)
@@ -67,7 +67,7 @@ module Fastlane
67
67
  end
68
68
 
69
69
  def self.authors
70
- ['loremattei']
70
+ ['Automattic']
71
71
  end
72
72
 
73
73
  def self.is_supported?(platform)
@@ -40,7 +40,7 @@ module Fastlane
40
40
  end
41
41
 
42
42
  def self.authors
43
- ['loremattei']
43
+ ['Automattic']
44
44
  end
45
45
 
46
46
  def self.is_supported?(platform)
@@ -71,7 +71,7 @@ module Fastlane
71
71
  end
72
72
 
73
73
  def self.authors
74
- ['loremattei']
74
+ ['Automattic']
75
75
  end
76
76
 
77
77
  def self.is_supported?(platform)
@@ -80,7 +80,7 @@ module Fastlane
80
80
  end
81
81
 
82
82
  def self.authors
83
- ['loremattei']
83
+ ['Automattic']
84
84
  end
85
85
 
86
86
  def self.is_supported?(platform)
@@ -51,7 +51,7 @@ module Fastlane
51
51
  end
52
52
 
53
53
  def self.authors
54
- ['loremattei']
54
+ ['Automattic']
55
55
  end
56
56
 
57
57
  def self.is_supported?(platform)