fastlane-plugin-get_new_build_number 0.2.6 → 0.2.9

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: f95b4015bb184f1d1fd21ef8e75ef0f05249c0aa1ae4a80b2854cd2d1bcd9615
4
- data.tar.gz: 85ba562e7a932c84c142c2d9a36bd364c1b7d630d441b9fc22c04f466cd9fcdf
3
+ metadata.gz: e62817a68887f485963d95dcafb8ca6af176895c52d0d87ba93f3424821ebda6
4
+ data.tar.gz: fbe69f5fa310ba95cb6c96fe5d1846480f8934600224aa8abafb0406ae873f7e
5
5
  SHA512:
6
- metadata.gz: f67caf04a5cf801b014b4033508507f8ba42856f51087f0deee91d47d741e91307206bba27ee05ddf2b3118a1212fb081f500dfd691a5b3f874c625cdd58b6fe
7
- data.tar.gz: af23163af0b07a37a4f92cfe96acf89157c6ab5a7586f31e5c82ab41d6569b820f3bab2e0890a972e267ba69176feebadb3ae359ba66f4302864792594f2601f
6
+ metadata.gz: 12079329701be634cc31bb99c163fb808568a0cbab41a02f1ccbd70a090a2f7876b0855f62b7af1aec1f3723fc18809bc4ad0b60660f172e1d5efde9b899d872
7
+ data.tar.gz: 0bf33138c75ea6c29cb01f5e19d19ef0c82114482feca3558cbf9398c392f6ee12149fd26d3377fc21954fd468accc46de265c1cbc1017fcb7b68db434f92107
@@ -21,23 +21,6 @@ module Fastlane
21
21
  "A string representing a new build name. It's the latest git tag with the first " \
22
22
  "character stripped (so v4.2.0 becomes 4.2.0)"
23
23
  end
24
-
25
- # def self.details
26
- # # Optional:
27
- # ""
28
- # end
29
-
30
- def self.available_options
31
- []
32
- end
33
-
34
- # def self.is_supported?(platform)
35
- # # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
36
- # # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
37
- # #
38
- # # [:ios, :mac, :android].include?(platform)
39
- # true
40
- # end
41
24
  end
42
25
  end
43
26
  end
@@ -21,7 +21,7 @@ module Fastlane
21
21
  UI.success("File with new number file exists. Reading build number from it...")
22
22
  latest_build_number = File.read(file).to_i
23
23
  else
24
- UI.message("File with new build number does not exist. New build number will be " \
24
+ UI.important("File with new build number does not exist. New build number will be " \
25
25
  "retrieved and temporary file with it will be created.")
26
26
  latest_build_number = Helper::GetNewBuildNumberHelper.get_latest_build_number(
27
27
  bundle_identifier: params[:bundle_identifier],
@@ -68,25 +68,41 @@ module Fastlane
68
68
  ].max
69
69
 
70
70
  UI.message("Latest build number (Google Play Store): #{google_play_build_number}")
71
-
71
+
72
72
  fad_build_number_ios = 0
73
- unless firebase_app_ios.nil?
74
- fad_build_number_ios = Fastlane::Actions::FirebaseAppDistributionGetLatestReleaseAction.run(
75
- app: firebase_app_ios,
76
- service_credentials_file: firebase_json_key_path
77
- )[:buildVersion].to_i
78
-
79
- UI.message("Latest build (Firebase App Distribution iOS): #{fad_build_number_ios}")
73
+ begin
74
+ unless firebase_app_ios.nil?
75
+ response = Fastlane::Actions::FirebaseAppDistributionGetLatestReleaseAction.run(
76
+ app: firebase_app_ios,
77
+ service_credentials_file: firebase_json_key_path
78
+ )
79
+
80
+ unless response.nil?
81
+ fad_build_number_ios = response[:buildVersion].to_i
82
+ end
83
+
84
+ UI.message("Latest build (Firebase App Distribution iOS): #{fad_build_number_ios}")
85
+ end
86
+ rescue StandardError => e
87
+ UI.error("Error getting latest build number (Firebase App Distribution iOS): #{e.message}")
80
88
  end
81
89
 
82
90
  fad_build_number_android = 0
83
- unless firebase_app_android.nil?
84
- fad_build_number_android = Fastlane::Actions::FirebaseAppDistributionGetLatestReleaseAction.run(
85
- app: firebase_app_android,
86
- service_credentials_file: firebase_json_key_path
87
- )[:buildVersion].to_i
88
-
89
- UI.message("Latest build (Firebase App Distribution Android): #{fad_build_number_android}")
91
+ begin
92
+ unless firebase_app_android.nil?
93
+ response = Fastlane::Actions::FirebaseAppDistributionGetLatestReleaseAction.run(
94
+ app: firebase_app_android,
95
+ service_credentials_file: firebase_json_key_path
96
+ )
97
+
98
+ unless response.nil?
99
+ fad_build_number_android = response[:buildVersion].to_i
100
+ end
101
+
102
+ UI.message("Latest build (Firebase App Distribution Android): #{fad_build_number_android}")
103
+ end
104
+ rescue StandardError => e
105
+ UI.error("Error getting latest build number (Firebase App Distribution Android): #{e.message}")
90
106
  end
91
107
 
92
108
  return [
@@ -100,17 +116,22 @@ module Fastlane
100
116
  # Returns the latest build number ("version code", in Android terminology)
101
117
  # for the given Google Play track.
102
118
  def self.get_google_play_build_number(track:, package_name:, json_key:)
103
- codes = Fastlane::Actions::GooglePlayTrackVersionCodesAction.run(
104
- track:,
105
- package_name:,
106
- json_key:
107
- )
119
+ begin
120
+ codes = Fastlane::Actions::GooglePlayTrackVersionCodesAction.run(
121
+ track:,
122
+ package_name:,
123
+ json_key:
124
+ )
108
125
 
109
- return codes.max
110
- rescue StandardError
111
- UI.message("No build numbers found for track #{track}")
112
- return 0
126
+ return codes.max
127
+ rescue StandardError
128
+ UI.message("No build numbers found for track #{track} (Google Play Store)")
129
+ return 0
130
+ end
113
131
  end
132
+
133
+ # TODO: Don't duplicate so much code
134
+ # def self.get_firebase_app_distribution_build_number()
114
135
  end
115
136
  end
116
137
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GetNewBuildNumber
3
- VERSION = "0.2.6"
3
+ VERSION = "0.2.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-get_new_build_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartek Pacia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-27 00:00:00.000000000 Z
11
+ date: 2022-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  requirements: []
200
- rubygems_version: 3.3.3
200
+ rubygems_version: 3.3.7
201
201
  signing_key:
202
202
  specification_version: 4
203
203
  summary: Retrieves the new build number for your app.