fastlane 2.150.0.rc6 → 2.150.0.rc7

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: 87c0c26f1a8fc4baab70230ea4478de1303401d512bce5564c7963f7d52aeee9
4
- data.tar.gz: 7093929e2f5d402e0623b5e2873a8178a8fcc74a711595ed9d038ca1e9f39e0d
3
+ metadata.gz: 34e85dcd86b90ee3b9187bc8417630a13c81188999870ddcc856dda2e11d2a7b
4
+ data.tar.gz: a3f719e25bfaac439e8a5052e68b16d63f94e2c2e2cf66ad5411b55970eb7f34
5
5
  SHA512:
6
- metadata.gz: f836a09c447b7b4ae447f6a78163a978620e104e06bf5f9b46fcbcbcad49baa089e153ab60aec1312d366a55e11369cc149de680d72f8e51582612c471b6f167
7
- data.tar.gz: cf0dd78f7208ce467c1be9fa1bd5bb5b9be1ffa8587ad0d9191c0370d41cc3aa8f1e8e92001fbcf7d7ee2e450d074c31111e6fde2eb23a500ced56cff87f34fc
6
+ metadata.gz: 0b769c9010489fab0525f1966896b3563e97877d2fa562d26614d3732a9f8a9e8cd08dc340043c094e9761892ff1c7aa469a09ff47744458a57f9d053cc06a3c
7
+ data.tar.gz: 5c4165e619e55db0c588a2298d5242103a35b7d785f04d3458f2cd5b73d3c7184e550096791244d15ec4c75541447e2850bbefeb51e4041dfd36d87e656309df
@@ -159,7 +159,10 @@ module Deliver
159
159
  end
160
160
 
161
161
  def reject_version_if_possible
162
- app = options[:app]
162
+ legacy_app = options[:app]
163
+ app_id = legacy_app.apple_id
164
+ app = Spaceship::ConnectAPI::App.get(app_id: app_id)
165
+
163
166
  if app.reject_version_if_possible!
164
167
  UI.success("Successfully rejected previous version!")
165
168
  end
@@ -106,7 +106,9 @@ module Deliver
106
106
  end
107
107
 
108
108
  # Needed for to filter out release notes from being sent up
109
- is_first_version = app.get_live_app_store_version(platform: platform).nil?
109
+ number_of_versions = app.get_app_store_versions(filter: { platform: platform }, limit: 2).size
110
+ is_first_version = number_of_versions == 1
111
+ UI.verbose("Version '#{version.version_string}' is the first version on App Store Connect") if is_first_version
110
112
 
111
113
  UI.important("Will begin uploading metadata for '#{version.version_string}' on App Store Connect")
112
114
 
@@ -158,7 +160,11 @@ module Deliver
158
160
  end
159
161
 
160
162
  release_type = if options[:auto_release_date]
161
- non_localized_version_attributes['earliestReleaseDate'] = options[:auto_release_date]
163
+ # Convert time format to 2020-06-17T12:00:00-07:00
164
+ time_in_ms = options[:auto_release_date]
165
+ date = convert_ms_to_iso8601(time_in_ms)
166
+
167
+ non_localized_version_attributes['earliestReleaseDate'] = date
162
168
  Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
163
169
  elsif options[:automatic_release]
164
170
  Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::AFTER_APPROVAL
@@ -315,6 +321,16 @@ module Deliver
315
321
 
316
322
  # rubocop:enable Metrics/PerceivedComplexity
317
323
 
324
+ def convert_ms_to_iso8601(time_in_ms)
325
+ time_in_s = time_in_ms / 1000
326
+
327
+ # Remove minutes and seconds (whole hour)
328
+ seconds_in_hour = 60 * 60
329
+ time_in_s_to_hour = (time_in_s / seconds_in_hour).to_i * seconds_in_hour
330
+
331
+ return Time.at(time_in_s_to_hour).strftime("%Y-%m-%dT%H:%M:%S%:z")
332
+ end
333
+
318
334
  # If the user is using the 'default' language, then assign values where they are needed
319
335
  def assign_defaults(options)
320
336
  # Normalizes languages keys from symbols to strings
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.150.0.rc6'.freeze
2
+ VERSION = '2.150.0.rc7'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze
@@ -110,6 +110,26 @@ module Spaceship
110
110
  # App Store Versions
111
111
  #
112
112
 
113
+ def reject_version_if_possible!
114
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
115
+ filter = {
116
+ appStoreState: [
117
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_DEVELOPER_RELEASE,
118
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
119
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::WAITING_FOR_REVIEW
120
+ ].join(","),
121
+ platform: platform
122
+ }
123
+
124
+ # Get the latest version
125
+ version = get_app_store_versions(filter: filter, includes: "appStoreVersionSubmission")
126
+ .sort_by { |v| Gem::Version.new(v.version_string) }
127
+ .last
128
+
129
+ return false if version.nil?
130
+ return version.reject!
131
+ end
132
+
113
133
  # Will make sure the current edit_version matches the given version number
114
134
  # This will either create a new version or change the version number
115
135
  # from an existing version
@@ -11,6 +11,9 @@ module Spaceship
11
11
 
12
12
  module AppStoreState
13
13
  READY_FOR_SALE = "READY_FOR_SALE"
14
+ PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
15
+ PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
16
+ IN_REVIEW = "IN_REVIEW"
14
17
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
15
18
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
16
19
  REJECTED = "REJECTED"
@@ -19,8 +19,13 @@ module Spaceship
19
19
  attr_accessor :downloadable
20
20
  attr_accessor :created_date
21
21
 
22
+ attr_accessor :app_store_version_submission
23
+
22
24
  module AppStoreState
23
25
  READY_FOR_SALE = "READY_FOR_SALE"
26
+ PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
27
+ PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
28
+ IN_REVIEW = "IN_REVIEW"
24
29
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
25
30
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
26
31
  REJECTED = "REJECTED"
@@ -47,13 +52,26 @@ module Spaceship
47
52
  "usesIdfa" => "uses_idfa",
48
53
  "isWatchOnly" => "is_watch_only",
49
54
  "downloadable" => "downloadable",
50
- "createdDate" => "created_date"
55
+ "createdDate" => "created_date",
56
+
57
+ "appStoreVersionSubmission" => "app_store_version_submission"
51
58
  })
52
59
 
53
60
  def self.type
54
61
  return "appStoreVersions"
55
62
  end
56
63
 
64
+ def can_reject?
65
+ raise "No app_store_version_submission included" unless app_store_version_submission
66
+ return app_store_version_submission.can_reject
67
+ end
68
+
69
+ def reject!
70
+ return false unless can_reject?
71
+ app_store_version_submission.delete!
72
+ return true
73
+ end
74
+
57
75
  #
58
76
  # API
59
77
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.150.0.rc6
4
+ version: 2.150.0.rc7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manu Wallner
@@ -29,7 +29,7 @@ authors:
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2020-06-30 00:00:00.000000000 Z
32
+ date: 2020-07-01 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: slack-notifier