fastlane-plugin-firebase_app_distribution 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43bd3ef5d8039fd654ebd1714e392946de5a99925068a968075b5d55d9b95e40
4
- data.tar.gz: 14093f5868a85275b05d1e69dcff7cb1b07efa90af0ab02e7eec3866b5fc4d41
3
+ metadata.gz: 9054b14c72ce1d0b5ee23da37fc3da51a2860b3249b07e5271d281c47570e5d0
4
+ data.tar.gz: 22e4f72109457476f1ab857e6dad86146ae3733972fda42cb80c8c73b89d42fc
5
5
  SHA512:
6
- metadata.gz: cdc2b3f3e407d58d6f5d03517242c0af4c6b3eeecd02ad20f00318bbbad415e01d4e5664d2a1e7bca8574cfd4c2b2753d16fa2713e50b6f1bee874b970c9a323
7
- data.tar.gz: 98e71f13d3b74b63f216904ee60b778cb39eb4bc9ff681ab9a857ddfd5bc8718b7c0c69fbd395beecd137abee5fe5dfc4db42e596b8020b10cc0fa2109eef8f1
6
+ metadata.gz: 80f3d004d4f6263a15c6aba591bb5ae10705dca4c9c31c8f6f0dc4f513e6fbe50310e605cae5b30a4c3bc28ac0eadca29d4bcd51b19b2ed3f970001df1b6d8fa
7
+ data.tar.gz: 4f4b8f3780fd86299ea1c393e6446e02e5e4414b498b4f85b764a27f8584395f88b40325d54e33bd6e782bc9fe3b58960e8ba72fd5e6e453aba3d563e555e14b
@@ -15,6 +15,8 @@ module Fastlane
15
15
  extend Auth::FirebaseAppDistributionAuthClient
16
16
  extend Helper::FirebaseAppDistributionHelper
17
17
 
18
+ DEFAULT_UPLOAD_TIMEOUT_SECONDS = 300
19
+
18
20
  def self.run(params)
19
21
  params.values # to validate all inputs before looking for the ipa/apk/aab
20
22
 
@@ -42,7 +44,9 @@ module Fastlane
42
44
  validate_aab_setup!(aab_info)
43
45
  end
44
46
 
45
- release_name = fad_api_client.upload(app_name, binary_path, platform.to_s)
47
+ upload_timeout = get_upload_timeout(params)
48
+
49
+ release_name = fad_api_client.upload(app_name, binary_path, platform.to_s, upload_timeout)
46
50
 
47
51
  if binary_type == :AAB && aab_info && !aab_info.certs_provided?
48
52
  updated_aab_info = fad_api_client.get_aab_info(app_name)
@@ -135,6 +139,14 @@ module Fastlane
135
139
  end
136
140
  end
137
141
 
142
+ def self.get_upload_timeout(params)
143
+ if params[:upload_timeout]
144
+ return params[:upload_timeout]
145
+ else
146
+ return DEFAULT_UPLOAD_TIMEOUT_SECONDS
147
+ end
148
+ end
149
+
138
150
  def self.validate_aab_setup!(aab_info)
139
151
  if aab_info && aab_info.integration_state != AabInfo::AabState::INTEGRATED && aab_info.integration_state != AabInfo::AabState::UNAVAILABLE
140
152
  case aab_info.integration_state
@@ -242,7 +254,12 @@ module Fastlane
242
254
  FastlaneCore::ConfigItem.new(key: :service_credentials_file,
243
255
  description: "Path to Google service account json",
244
256
  optional: true,
245
- type: String)
257
+ type: String),
258
+ FastlaneCore::ConfigItem.new(key: :upload_timeout,
259
+ description: "The amount of seconds before the upload will timeout, if not completed",
260
+ optional: true,
261
+ default_value: DEFAULT_UPLOAD_TIMEOUT_SECONDS,
262
+ type: Integer)
246
263
  ]
247
264
  end
248
265
 
@@ -106,11 +106,12 @@ module Fastlane
106
106
  # app_name - Firebase App resource name
107
107
  # binary_path - Absolute path to your app's aab/apk/ipa file
108
108
  # platform - 'android' or 'ios'
109
+ # timeout - The amount of seconds before the upload will timeout, if not completed
109
110
  #
110
111
  # Throws a user_error if the binary file does not exist
111
- def upload_binary(app_name, binary_path, platform)
112
+ def upload_binary(app_name, binary_path, platform, timeout)
112
113
  response = connection.post(binary_upload_url(app_name), read_binary(binary_path)) do |request|
113
- request.options.timeout = 300 # seconds
114
+ request.options.timeout = timeout # seconds
114
115
  request.headers[AUTHORIZATION] = "Bearer " + @auth_token
115
116
  request.headers[CONTENT_TYPE] = APPLICATION_OCTET_STREAM
116
117
  request.headers[CLIENT_VERSION] = client_version_header_value
@@ -130,16 +131,17 @@ module Fastlane
130
131
  # args
131
132
  # app_name - Firebase App resource name
132
133
  # binary_path - Absolute path to your app's aab/apk/ipa file
134
+ # timeout - The amount of seconds before the upload will timeout, if not completed
133
135
  #
134
136
  # Returns the release_name of the uploaded release.
135
137
  #
136
138
  # Crashes if the number of polling retries exceeds MAX_POLLING_RETRIES or if the binary cannot
137
139
  # be uploaded.
138
- def upload(app_name, binary_path, platform)
140
+ def upload(app_name, binary_path, platform, timeout)
139
141
  binary_type = binary_type_from_path(binary_path)
140
142
 
141
143
  UI.message("⌛ Uploading the #{binary_type}.")
142
- operation_name = upload_binary(app_name, binary_path, platform)
144
+ operation_name = upload_binary(app_name, binary_path, platform, timeout)
143
145
 
144
146
  upload_status_response = get_upload_status(operation_name)
145
147
  MAX_POLLING_RETRIES.times do
@@ -24,24 +24,23 @@ module Fastlane
24
24
  # Crashes if given invalid or missing credentials
25
25
  def fetch_auth_token(google_service_path, firebase_cli_token, debug = false)
26
26
  if !google_service_path.nil? && !google_service_path.empty?
27
- UI.message("Authenticating with --service_credentials_file path parameter: #{google_service_path}")
27
+ UI.message("🔐 Authenticating with --service_credentials_file path parameter: #{google_service_path}")
28
28
  token = service_account(google_service_path, debug)
29
29
  elsif !firebase_cli_token.nil? && !firebase_cli_token.empty?
30
- UI.message("Authenticating with --firebase_cli_token parameter")
30
+ UI.message("🔐 Authenticating with --firebase_cli_token parameter")
31
31
  token = firebase_token(firebase_cli_token, debug)
32
32
  elsif !ENV["FIREBASE_TOKEN"].nil? && !ENV["FIREBASE_TOKEN"].empty?
33
- UI.message("Authenticating with FIREBASE_TOKEN environment variable")
33
+ UI.message("🔐 Authenticating with FIREBASE_TOKEN environment variable")
34
34
  token = firebase_token(ENV["FIREBASE_TOKEN"], debug)
35
35
  elsif !ENV["GOOGLE_APPLICATION_CREDENTIALS"].nil? && !ENV["GOOGLE_APPLICATION_CREDENTIALS"].empty?
36
- UI.message("Authenticating with GOOGLE_APPLICATION_CREDENTIALS environment variable: #{ENV['GOOGLE_APPLICATION_CREDENTIALS']}")
36
+ UI.message("🔐 Authenticating with GOOGLE_APPLICATION_CREDENTIALS environment variable: #{ENV['GOOGLE_APPLICATION_CREDENTIALS']}")
37
37
  token = service_account(ENV["GOOGLE_APPLICATION_CREDENTIALS"], debug)
38
38
  elsif (refresh_token = refresh_token_from_firebase_tools)
39
- UI.message("No authentication method specified. Using cached Firebase CLI credentials.")
39
+ UI.message("🔐 No authentication method specified. Using cached Firebase CLI credentials.")
40
40
  token = firebase_token(refresh_token, debug)
41
41
  else
42
42
  UI.user_error!(ErrorMessage::MISSING_CREDENTIALS)
43
43
  end
44
- UI.success("🔐 Authenticated successfully.")
45
44
  token
46
45
  end
47
46
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FirebaseAppDistribution
3
- VERSION = "0.3.7"
3
+ VERSION = "0.3.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-firebase_app_distribution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
8
8
  - Manny Jimenez
9
9
  - Alonso Salas Infante
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-09-28 00:00:00.000000000 Z
13
+ date: 2022-12-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry
@@ -138,7 +138,7 @@ dependencies:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: 2.127.1
141
- description:
141
+ description:
142
142
  email:
143
143
  - snatchev@google.com
144
144
  - mannyjimenez@google.com
@@ -169,7 +169,7 @@ homepage: https://github.com/fastlane/fastlane-plugin-firebase_app_distribution
169
169
  licenses:
170
170
  - MIT
171
171
  metadata: {}
172
- post_install_message:
172
+ post_install_message:
173
173
  rdoc_options: []
174
174
  require_paths:
175
175
  - lib
@@ -184,8 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubygems_version: 3.0.3.1
188
- signing_key:
187
+ rubygems_version: 3.1.6
188
+ signing_key:
189
189
  specification_version: 4
190
190
  summary: Release your beta builds to Firebase App Distribution. https://firebase.google.com/docs/app-distribution
191
191
  test_files: []