fastlane-plugin-firebase_app_distribution 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb +1 -29
- data/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_get_latest_release.rb +15 -6
- data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_helper.rb +41 -3
- data/lib/fastlane/plugin/firebase_app_distribution/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 789a32fce54326215942dfb99d0bb843887a36d84ca3ecfc474d4408b02c103d
|
4
|
+
data.tar.gz: f2d3b26d638efddc8920e9df5b01bbb4efa176e26d91a33cb8ab781b2996ac11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72c6db99756504fc29a2e5ef24baf600a5bb13ddb3758385b240876fc5d3cf891c5c9bdc7037400aa3272d5aefe1fd2cdb2f2ea677b0dfa12f9fab78636012d3
|
7
|
+
data.tar.gz: d8a9c0d7ffc1d44813d8f97944d3db5dc3d3bf0eedfb4af3f89d4353d4bb3483a7ce4e7ae39bd502f1a302cc2ac94572ddee07842974644bbff0e9d02cf25cec
|
data/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb
CHANGED
@@ -142,34 +142,6 @@ module Fastlane
|
|
142
142
|
test_password && test_password.sub(/\r?\n$/, "")
|
143
143
|
end
|
144
144
|
|
145
|
-
def self.app_id_from_params(params)
|
146
|
-
if params[:app]
|
147
|
-
app_id = params[:app]
|
148
|
-
elsif xcode_archive_path
|
149
|
-
plist_path = params[:googleservice_info_plist_path]
|
150
|
-
app_id = get_ios_app_id_from_archive_plist(xcode_archive_path, plist_path)
|
151
|
-
end
|
152
|
-
if app_id.nil?
|
153
|
-
UI.crash!(ErrorMessage::MISSING_APP_ID)
|
154
|
-
end
|
155
|
-
app_id
|
156
|
-
end
|
157
|
-
|
158
|
-
def self.xcode_archive_path
|
159
|
-
# prevents issues on cross-platform build environments where an XCode build happens within
|
160
|
-
# the same lane
|
161
|
-
return nil if lane_platform == :android
|
162
|
-
|
163
|
-
# rubocop:disable Require/MissingRequireStatement
|
164
|
-
Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE]
|
165
|
-
# rubocop:enable Require/MissingRequireStatement
|
166
|
-
end
|
167
|
-
|
168
|
-
def self.lane_platform
|
169
|
-
# to_sym shouldn't be necessary, but possibly fixes #376
|
170
|
-
Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]&.to_sym
|
171
|
-
end
|
172
|
-
|
173
145
|
def self.platform_from_app_id(app_id)
|
174
146
|
if app_id.include?(':ios:')
|
175
147
|
:ios
|
@@ -492,7 +464,7 @@ module Fastlane
|
|
492
464
|
optional: true),
|
493
465
|
FastlaneCore::ConfigItem.new(key: :googleservice_info_plist_path,
|
494
466
|
env_name: "GOOGLESERVICE_INFO_PLIST_PATH",
|
495
|
-
description: "Path to your GoogleService-Info.plist file, relative to the archived product path",
|
467
|
+
description: "Path to your GoogleService-Info.plist file, relative to the archived product path (or directly, if no archived product path is found)",
|
496
468
|
default_value: "GoogleService-Info.plist",
|
497
469
|
optional: true,
|
498
470
|
type: String),
|
@@ -19,15 +19,15 @@ module Fastlane
|
|
19
19
|
client = Google::Apis::FirebaseappdistributionV1::FirebaseAppDistributionService.new
|
20
20
|
client.authorization = get_authorization(params[:service_credentials_file], params[:firebase_cli_token], params[:service_credentials_json_data], params[:debug])
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
parent = app_name_from_app_id(
|
22
|
+
app_id = app_id_from_params(params)
|
23
|
+
UI.message("⏳ Fetching latest release for app #{app_id}...")
|
24
|
+
parent = app_name_from_app_id(app_id)
|
25
25
|
|
26
26
|
begin
|
27
27
|
releases = client.list_project_app_releases(parent, page_size: 1).releases
|
28
28
|
rescue Google::Apis::Error => err
|
29
29
|
if err.status_code.to_i == 404
|
30
|
-
UI.user_error!("#{ErrorMessage::INVALID_APP_ID}: #{
|
30
|
+
UI.user_error!("#{ErrorMessage::INVALID_APP_ID}: #{app_id}")
|
31
31
|
else
|
32
32
|
UI.crash!(err)
|
33
33
|
end
|
@@ -35,7 +35,7 @@ module Fastlane
|
|
35
35
|
|
36
36
|
if releases.nil? || releases.empty?
|
37
37
|
latest_release = nil
|
38
|
-
UI.important("No releases for app #{
|
38
|
+
UI.important("No releases for app #{app_id} found in App Distribution. Returning nil and setting Actions.lane_context[SharedValues::FIREBASE_APP_DISTRO_LATEST_RELEASE].")
|
39
39
|
else
|
40
40
|
# latest_release = append_json_style_fields(response.releases[0].to_h)
|
41
41
|
latest_release = map_release_hash(releases[0])
|
@@ -80,10 +80,19 @@ module Fastlane
|
|
80
80
|
|
81
81
|
def self.available_options
|
82
82
|
[
|
83
|
+
# iOS Specific
|
84
|
+
FastlaneCore::ConfigItem.new(key: :googleservice_info_plist_path,
|
85
|
+
env_name: "GOOGLESERVICE_INFO_PLIST_PATH",
|
86
|
+
description: "Path to your GoogleService-Info.plist file, relative to the archived product path (or directly, if no archived product path is found)",
|
87
|
+
default_value: "GoogleService-Info.plist",
|
88
|
+
optional: true,
|
89
|
+
type: String),
|
90
|
+
|
91
|
+
# General
|
83
92
|
FastlaneCore::ConfigItem.new(key: :app,
|
84
93
|
env_name: "FIREBASEAPPDISTRO_APP",
|
85
94
|
description: "Your app's Firebase App ID. You can find the App ID in the Firebase console, on the General Settings page",
|
86
|
-
optional:
|
95
|
+
optional: true,
|
87
96
|
type: String),
|
88
97
|
FastlaneCore::ConfigItem.new(key: :firebase_cli_token,
|
89
98
|
description: "Auth token generated using Firebase CLI's login:ci command",
|
data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_helper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'fastlane/action'
|
1
2
|
require 'fastlane_core/ui/ui'
|
2
3
|
require 'cfpropertylist'
|
3
4
|
require 'google/apis/core'
|
@@ -36,15 +37,52 @@ module Fastlane
|
|
36
37
|
string.strip.split(delimiter).map(&:strip)
|
37
38
|
end
|
38
39
|
|
40
|
+
def app_id_from_params(params)
|
41
|
+
plist_path = params[:googleservice_info_plist_path]
|
42
|
+
if params[:app]
|
43
|
+
UI.message("Using app ID from 'app' parameter")
|
44
|
+
app_id = params[:app]
|
45
|
+
elsif xcode_archive_path
|
46
|
+
UI.message("Using app ID from the GoogleService-Info.plist file located using the 'googleservice_info_plist_path' parameter, relative to the archive path: #{xcode_archive_path}")
|
47
|
+
app_id = get_ios_app_id_from_archive_plist(xcode_archive_path, plist_path)
|
48
|
+
elsif plist_path
|
49
|
+
UI.message("Using app ID from the GoogleService-Info.plist file located using the 'googleservice_info_plist_path' parameter directly since no archive path was found")
|
50
|
+
app_id = get_ios_app_id_from_plist(plist_path)
|
51
|
+
end
|
52
|
+
if app_id.nil?
|
53
|
+
UI.crash!(ErrorMessage::MISSING_APP_ID)
|
54
|
+
end
|
55
|
+
app_id
|
56
|
+
end
|
57
|
+
|
58
|
+
def lane_platform
|
59
|
+
# to_sym shouldn't be necessary, but possibly fixes #376
|
60
|
+
Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]&.to_sym
|
61
|
+
end
|
62
|
+
|
63
|
+
def xcode_archive_path
|
64
|
+
# prevents issues on cross-platform build environments where an XCode build happens within
|
65
|
+
# the same lane
|
66
|
+
return nil if lane_platform == :android
|
67
|
+
|
68
|
+
# rubocop:disable Require/MissingRequireStatement
|
69
|
+
Actions.lane_context[Actions::SharedValues::XCODEBUILD_ARCHIVE]
|
70
|
+
# rubocop:enable Require/MissingRequireStatement
|
71
|
+
end
|
72
|
+
|
39
73
|
def parse_plist(path)
|
40
74
|
CFPropertyList.native_types(CFPropertyList::List.new(file: path).value)
|
41
75
|
end
|
42
76
|
|
43
|
-
def get_ios_app_id_from_archive_plist(archive_path,
|
77
|
+
def get_ios_app_id_from_archive_plist(archive_path, relative_plist_path)
|
44
78
|
app_path = parse_plist("#{archive_path}/Info.plist")["ApplicationProperties"]["ApplicationPath"]
|
45
79
|
UI.shell_error!("can't extract application path from Info.plist at #{archive_path}") if app_path.empty?
|
46
|
-
|
47
|
-
|
80
|
+
return get_ios_app_id_from_plist("#{archive_path}/Products/#{app_path}/#{relative_plist_path}")
|
81
|
+
end
|
82
|
+
|
83
|
+
def get_ios_app_id_from_plist(plist_path)
|
84
|
+
identifier = parse_plist(plist_path)["GOOGLE_APP_ID"]
|
85
|
+
UI.shell_error!("can't extract GOOGLE_APP_ID from #{plist_path}") if identifier.empty?
|
48
86
|
return identifier
|
49
87
|
end
|
50
88
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-firebase_app_distribution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Natchev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
- Alonso Salas Infante
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-apis-firebaseappdistribution_v1
|