fastlane-plugin-firebase_app_distribution 0.3.7 → 0.4.0.pre.1

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: ead39ff778cdc9d618dba283f3b3b3149d7c8627bd2dd151836dad8c18f1e933
4
+ data.tar.gz: 258676867d23801518d9f5945c771a047595860e2e9814570ba495674f0d71c6
5
5
  SHA512:
6
- metadata.gz: cdc2b3f3e407d58d6f5d03517242c0af4c6b3eeecd02ad20f00318bbbad415e01d4e5664d2a1e7bca8574cfd4c2b2753d16fa2713e50b6f1bee874b970c9a323
7
- data.tar.gz: 98e71f13d3b74b63f216904ee60b778cb39eb4bc9ff681ab9a857ddfd5bc8718b7c0c69fbd395beecd137abee5fe5dfc4db42e596b8020b10cc0fa2109eef8f1
6
+ metadata.gz: 21803dd990c28b6053663e2a360c158cc858290f55bdd346b4843680c17dd40f7a5aa6c54572aa9614586045c7673e8c0176a525a8e886d8dd777b4c1a55527e
7
+ data.tar.gz: 6a72e46140d9eb893c76fb0a5084738465e5feaec313c50e1c40cfaea2ebf7b98f9a18d0049d9c8b1fb032f86497ce9de68da6a104267263e80ce134536978f3
@@ -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,10 @@ 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
+ upload_status_response = fad_api_client.upload(app_name, binary_path, platform.to_s, upload_timeout)
50
+ release_name = upload_status_response.release_name
46
51
 
47
52
  if binary_type == :AAB && aab_info && !aab_info.certs_provided?
48
53
  updated_aab_info = fad_api_client.get_aab_info(app_name)
@@ -65,6 +70,18 @@ module Fastlane
65
70
  group_aliases = string_to_array(groups)
66
71
  fad_api_client.distribute(release_name, emails, group_aliases)
67
72
  UI.success("🎉 App Distribution upload finished successfully.")
73
+
74
+ if upload_status_response.firebase_console_uri
75
+ UI.message("🔗 View this release in the Firebase console: #{upload_status_response.firebase_console_uri}")
76
+ end
77
+
78
+ if upload_status_response.testing_uri
79
+ UI.message("🔗 Share this release with testers: #{upload_status_response.testing_uri}")
80
+ end
81
+
82
+ if upload_status_response.binary_download_uri
83
+ UI.message("🔗 Download the release binary (link expires in 1 hour): #{upload_status_response.binary_download_uri}")
84
+ end
68
85
  end
69
86
 
70
87
  def self.description
@@ -135,6 +152,14 @@ module Fastlane
135
152
  end
136
153
  end
137
154
 
155
+ def self.get_upload_timeout(params)
156
+ if params[:upload_timeout]
157
+ return params[:upload_timeout]
158
+ else
159
+ return DEFAULT_UPLOAD_TIMEOUT_SECONDS
160
+ end
161
+ end
162
+
138
163
  def self.validate_aab_setup!(aab_info)
139
164
  if aab_info && aab_info.integration_state != AabInfo::AabState::INTEGRATED && aab_info.integration_state != AabInfo::AabState::UNAVAILABLE
140
165
  case aab_info.integration_state
@@ -242,7 +267,12 @@ module Fastlane
242
267
  FastlaneCore::ConfigItem.new(key: :service_credentials_file,
243
268
  description: "Path to Google service account json",
244
269
  optional: true,
245
- type: String)
270
+ type: String),
271
+ FastlaneCore::ConfigItem.new(key: :upload_timeout,
272
+ description: "The amount of seconds before the upload will timeout, if not completed",
273
+ optional: true,
274
+ default_value: DEFAULT_UPLOAD_TIMEOUT_SECONDS,
275
+ type: Integer)
246
276
  ]
247
277
  end
248
278
 
@@ -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
@@ -169,7 +171,7 @@ module Fastlane
169
171
  UI.crash!("It took longer than expected to process your #{binary_type}, please try again.")
170
172
  end
171
173
 
172
- upload_status_response.release_name
174
+ upload_status_response
173
175
  end
174
176
 
175
177
  # Fetches the status of an uploaded binary
@@ -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
 
@@ -31,6 +31,18 @@ class UploadStatusResponse
31
31
  end
32
32
  end
33
33
 
34
+ def firebase_console_uri
35
+ release ? release[:firebaseConsoleUri] : nil
36
+ end
37
+
38
+ def testing_uri
39
+ release ? release[:testingUri] : nil
40
+ end
41
+
42
+ def binary_download_uri
43
+ release ? release[:binaryDownloadUri] : nil
44
+ end
45
+
34
46
  def status
35
47
  response ? response[:result] : nil
36
48
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FirebaseAppDistribution
3
- VERSION = "0.3.7"
3
+ VERSION = "0.4.0.pre.1"
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.4.0.pre.1
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: 2023-01-17 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
@@ -180,12 +180,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - ">="
183
+ - - ">"
184
184
  - !ruby/object:Gem::Version
185
- version: '0'
185
+ version: 1.3.1
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: []