fastlane 2.241.1 → 2.242.0

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.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -39
  3. data/cert/lib/cert/runner.rb +1 -1
  4. data/credentials_manager/README.md +3 -3
  5. data/credentials_manager/lib/credentials_manager/account_manager.rb +13 -3
  6. data/deliver/lib/deliver/runner.rb +5 -0
  7. data/fastlane/lib/assets/certificates/AppleIncRootCertificate.cer +0 -0
  8. data/fastlane/lib/assets/certificates/AppleRootCA-G3.cer +0 -0
  9. data/fastlane/lib/fastlane/action.rb +8 -6
  10. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +1 -1
  11. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +0 -3
  12. data/fastlane/lib/fastlane/actions/clipboard.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/commit_version_bump.rb +0 -1
  14. data/fastlane/lib/fastlane/actions/create_keychain.rb +20 -29
  15. data/fastlane/lib/fastlane/actions/delete_keychain.rb +5 -3
  16. data/fastlane/lib/fastlane/actions/docs/build_app.md +1 -1
  17. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -1
  18. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +4 -4
  19. data/fastlane/lib/fastlane/actions/docs/get_provisioning_profile.md +1 -1
  20. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +1 -1
  21. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +12 -0
  22. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +5 -4
  23. data/fastlane/lib/fastlane/actions/download_dsyms.rb +3 -1
  24. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +1 -0
  25. data/fastlane/lib/fastlane/actions/git_pull.rb +1 -1
  26. data/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb +0 -1
  27. data/fastlane/lib/fastlane/actions/import_certificate.rb +18 -6
  28. data/fastlane/lib/fastlane/actions/import_from_gem.rb +70 -0
  29. data/fastlane/lib/fastlane/actions/jazzy.rb +1 -1
  30. data/fastlane/lib/fastlane/actions/lcov.rb +1 -1
  31. data/fastlane/lib/fastlane/actions/mailgun.rb +2 -2
  32. data/fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb +1 -1
  33. data/fastlane/lib/fastlane/actions/notarize.rb +55 -7
  34. data/fastlane/lib/fastlane/actions/prompt.rb +1 -1
  35. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +2 -2
  36. data/fastlane/lib/fastlane/actions/sh.rb +20 -2
  37. data/fastlane/lib/fastlane/actions/sourcedocs.rb +2 -2
  38. data/fastlane/lib/fastlane/actions/swiftlint.rb +5 -2
  39. data/fastlane/lib/fastlane/actions/unlock_keychain.rb +17 -29
  40. data/fastlane/lib/fastlane/actions/update_fastlane.rb +10 -3
  41. data/fastlane/lib/fastlane/actions/update_project_code_signing.rb +2 -1
  42. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +21 -18
  43. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +1 -1
  44. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +8 -2
  45. data/fastlane/lib/fastlane/actions/verify_build.rb +2 -1
  46. data/fastlane/lib/fastlane/actions/verify_pod_keys.rb +2 -1
  47. data/fastlane/lib/fastlane/actions/xcodebuild.rb +1 -1
  48. data/fastlane/lib/fastlane/cli_tools_distributor.rb +7 -0
  49. data/fastlane/lib/fastlane/commands_generator.rb +7 -1
  50. data/fastlane/lib/fastlane/environment_printer.rb +14 -14
  51. data/fastlane/lib/fastlane/fast_file.rb +35 -4
  52. data/fastlane/lib/fastlane/helper/sh_helper.rb +27 -45
  53. data/fastlane/lib/fastlane/lane_list.rb +1 -1
  54. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +2 -2
  55. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +0 -2
  56. data/fastlane/lib/fastlane/runner.rb +4 -6
  57. data/fastlane/lib/fastlane/server/socket_server.rb +57 -7
  58. data/fastlane/lib/fastlane/server/socket_server_action_command_executor.rb +4 -4
  59. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +3 -3
  60. data/fastlane/lib/fastlane/swift_lane_manager.rb +32 -11
  61. data/fastlane/lib/fastlane/version.rb +2 -1
  62. data/fastlane/swift/ArgumentProcessor.swift +10 -2
  63. data/fastlane/swift/Deliverfile.swift +1 -1
  64. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  65. data/fastlane/swift/Fastlane.swift +46 -152
  66. data/fastlane/swift/Gymfile.swift +1 -1
  67. data/fastlane/swift/GymfileProtocol.swift +1 -1
  68. data/fastlane/swift/MainProcess.swift +27 -0
  69. data/fastlane/swift/Matchfile.swift +1 -1
  70. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  71. data/fastlane/swift/Precheckfile.swift +1 -1
  72. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  73. data/fastlane/swift/RubyCommand.swift +1 -9
  74. data/fastlane/swift/RubyCommandable.swift +3 -2
  75. data/fastlane/swift/Runner.swift +1 -1
  76. data/fastlane/swift/Scanfile.swift +1 -1
  77. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  78. data/fastlane/swift/Screengrabfile.swift +1 -1
  79. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  80. data/fastlane/swift/Snapshotfile.swift +1 -1
  81. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  82. data/fastlane/swift/main.swift +1 -1
  83. data/fastlane_core/lib/fastlane_core/cert_checker.rb +40 -76
  84. data/fastlane_core/lib/fastlane_core/command_executor.rb +128 -7
  85. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -1
  86. data/fastlane_core/lib/fastlane_core/configuration/configuration_file.rb +1 -1
  87. data/fastlane_core/lib/fastlane_core/device_manager.rb +14 -5
  88. data/fastlane_core/lib/fastlane_core/fastlane_pty.rb +25 -10
  89. data/fastlane_core/lib/fastlane_core/helper.rb +26 -2
  90. data/fastlane_core/lib/fastlane_core/ios_app_identifier_guesser.rb +1 -1
  91. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +41 -22
  92. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +48 -71
  93. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +5 -1
  94. data/fastlane_core/lib/fastlane_core/print_table.rb +1 -1
  95. data/fastlane_core/lib/fastlane_core/queue_worker.rb +0 -2
  96. data/fastlane_core/lib/fastlane_core/stored_passwords.rb +29 -0
  97. data/fastlane_core/lib/fastlane_core/string_filters.rb +1 -2
  98. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +8 -4
  99. data/fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb +2 -2
  100. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +1 -1
  101. data/frameit/lib/frameit/device_types.rb +11 -4
  102. data/frameit/lib/frameit/editor.rb +31 -12
  103. data/frameit/lib/frameit/frame_downloader.rb +4 -1
  104. data/gym/lib/gym/detect_values.rb +10 -10
  105. data/gym/lib/gym/options.rb +1 -7
  106. data/gym/lib/gym/runner.rb +6 -1
  107. data/match/lib/match/encryption/encryption.rb +6 -1
  108. data/match/lib/match/encryption/openssl.rb +8 -3
  109. data/match/lib/match/portal_fetcher.rb +12 -6
  110. data/match/lib/match/runner.rb +4 -1
  111. data/match/lib/match/storage/gitlab/secure_file.rb +2 -1
  112. data/match/lib/match/storage/google_cloud_storage.rb +1 -1
  113. data/match/lib/match/storage/interface.rb +10 -0
  114. data/match/lib/match/storage/s3_storage.rb +1 -1
  115. data/pem/lib/pem/manager.rb +3 -3
  116. data/precheck/lib/precheck/runner.rb +4 -2
  117. data/scan/lib/scan/detect_values.rb +0 -1
  118. data/scan/lib/scan/runner.rb +1 -0
  119. data/sigh/lib/assets/resign.sh +10 -3
  120. data/sigh/lib/sigh/manager.rb +5 -1
  121. data/sigh/lib/sigh/resign.rb +5 -21
  122. data/snapshot/lib/snapshot/reset_simulators.rb +5 -2
  123. data/snapshot/lib/snapshot/runner.rb +0 -1
  124. data/spaceship/lib/spaceship/base.rb +1 -1
  125. data/spaceship/lib/spaceship/client.rb +13 -4
  126. data/spaceship/lib/spaceship/connect_api/api_client.rb +12 -14
  127. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +1 -1
  128. data/spaceship/lib/spaceship/connect_api/models/user.rb +7 -3
  129. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +9 -11
  130. data/spaceship/lib/spaceship/connect_api/token.rb +21 -1
  131. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +3 -1
  132. data/spaceship/lib/spaceship/helper/plist_middleware.rb +2 -2
  133. data/spaceship/lib/spaceship/portal/portal_client.rb +8 -8
  134. data/spaceship/lib/spaceship/test_flight/client.rb +1 -5
  135. data/supply/lib/supply/client.rb +1 -1
  136. data/supply/lib/supply/options.rb +6 -0
  137. data/supply/lib/supply/uploader.rb +28 -2
  138. metadata +28 -25
  139. data/fastlane/lib/fastlane/actions/hockey.rb +0 -400
  140. data/fastlane/lib/fastlane/actions/typetalk.rb +0 -93
@@ -169,8 +169,7 @@ module Spaceship
169
169
  status = response.status if response
170
170
 
171
171
  if [500, 504].include?(status)
172
- msg = "Timeout received! Retrying after 3 seconds (remaining: #{tries})..."
173
- raise TimeoutRetryError, msg
172
+ raise TimeoutRetryError, "Server error got #{status}"
174
173
  end
175
174
 
176
175
  if status == 429
@@ -191,10 +190,10 @@ module Spaceship
191
190
  end
192
191
  rescue TimeoutRetryError => error
193
192
  tries -= 1
194
- puts(error) if Spaceship::Globals.verbose?
195
193
  if tries.zero?
196
194
  return response
197
195
  else
196
+ puts("#{error.message}, retrying (remaining: #{tries})...") if Spaceship::Globals.verbose?
198
197
  retry
199
198
  end
200
199
  rescue TooManyRequestsError => error
@@ -233,7 +232,7 @@ module Spaceship
233
232
  def handle_error(response)
234
233
  body = response.body.empty? ? {} : response.body
235
234
 
236
- # Setting body nil if invalid JSON which can happen if 502
235
+ # A body that is not JSON, such as a 502 page, stays a String
237
236
  begin
238
237
  body = JSON.parse(body) if body.kind_of?(String)
239
238
  rescue
@@ -244,7 +243,8 @@ module Spaceship
244
243
  when 401
245
244
  raise UnauthorizedAccessError, format_errors(response)
246
245
  when 403
247
- error = (body['errors'] || []).first || {}
246
+ errors = body['errors'] if body.kind_of?(Hash)
247
+ error = (errors || []).first || {}
248
248
  error_code = error['code']
249
249
  if error_code == "FORBIDDEN.REQUIRED_AGREEMENTS_MISSING_OR_EXPIRED"
250
250
  raise ProgramLicenseAgreementUpdated, format_errors(response)
@@ -335,7 +335,13 @@ module Spaceship
335
335
  # }
336
336
 
337
337
  body = response.body.empty? ? {} : response.body
338
- body = JSON.parse(body) if body.kind_of?(String)
338
+ if body.kind_of?(String)
339
+ begin
340
+ body = JSON.parse(body)
341
+ rescue JSON::ParserError
342
+ return body # not JSON, such as an HTML error page
343
+ end
344
+ end
339
345
 
340
346
  formatted_errors = (body['errors'] || []).map do |error|
341
347
  messages = [[error['title'], error['detail'], error.dig("source", "pointer")].compact.join(" - ")]
@@ -357,14 +363,6 @@ module Spaceship
357
363
 
358
364
  private
359
365
 
360
- def local_variable_get(binding, name)
361
- if binding.respond_to?(:local_variable_get)
362
- binding.local_variable_get(name)
363
- else
364
- binding.eval(name.to_s)
365
- end
366
- end
367
-
368
366
  def provider_id
369
367
  return team_id if self.provider.nil?
370
368
  self.provider.provider_id
@@ -41,7 +41,7 @@ module Spaceship
41
41
 
42
42
  def self.all(client: nil, filter: {}, includes: nil, fields: nil, limit: Spaceship::ConnectAPI::MAX_OBJECTS_PER_PAGE_LIMIT, sort: nil)
43
43
  client ||= Spaceship::ConnectAPI
44
- resps = client.get_bundle_ids(filter: filter, includes: includes, fields: fields, limit: nil, sort: nil).all_pages
44
+ resps = client.get_bundle_ids(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort).all_pages
45
45
  return resps.flat_map(&:to_models)
46
46
  end
47
47
 
@@ -1,4 +1,5 @@
1
1
  require_relative '../model'
2
+
2
3
  module Spaceship
3
4
  class ConnectAPI
4
5
  class User
@@ -56,19 +57,22 @@ module Spaceship
56
57
  CUSTOMER_SUPPORT = "CUSTOMER_SUPPORT"
57
58
  end
58
59
 
60
+ # Not at the top: connect_api loads user_invitation.rb, which reads UserRole while it loads
61
+ require_relative '../../connect_api'
62
+
59
63
  #
60
64
  # API
61
65
  #
62
66
 
63
- def self.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, limit: nil, sort: nil)
67
+ def self.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, limit: Spaceship::ConnectAPI::MAX_OBJECTS_PER_PAGE_LIMIT, sort: nil)
64
68
  client ||= Spaceship::ConnectAPI
65
- resps = client.get_users(filter: filter, includes: includes).all_pages
69
+ resps = client.get_users(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
66
70
  return resps.flat_map(&:to_models)
67
71
  end
68
72
 
69
73
  def self.find(client: nil, email: nil, includes: ESSENTIAL_INCLUDES)
70
74
  client ||= Spaceship::ConnectAPI
71
- return all(client: client, filter: { email: email }, includes: includes)
75
+ return all(client: client, filter: { username: email }, includes: includes)
72
76
  end
73
77
 
74
78
  # @param client [ConnectAPI] ConnectAPI client.
@@ -209,22 +209,20 @@ module Spaceship
209
209
  end
210
210
 
211
211
  def create_beta_group(app_id: nil, group_name: nil, is_internal_group: false, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false, has_access_to_all_builds: nil)
212
+ attributes = { name: group_name, isInternalGroup: is_internal_group }
212
213
  if is_internal_group
213
- has_access_to_all_builds = true if has_access_to_all_builds.nil?
214
+ # Apple's docs don't say which groups take hasAccessToAllBuilds; fastlane sends it for internal groups only, as since #21478
215
+ attributes[:hasAccessToAllBuilds] = has_access_to_all_builds.nil? ? true : has_access_to_all_builds
214
216
  else
215
- # Access to all builds is only for internal groups
216
- has_access_to_all_builds = nil
217
+ attributes.merge!(
218
+ publicLinkEnabled: public_link_enabled,
219
+ publicLinkLimit: public_link_limit,
220
+ publicLinkLimitEnabled: public_link_limit_enabled
221
+ )
217
222
  end
218
223
  body = {
219
224
  data: {
220
- attributes: {
221
- name: group_name,
222
- isInternalGroup: is_internal_group,
223
- hasAccessToAllBuilds: has_access_to_all_builds, # Undocumented of 2021-08-02 in ASC API docs and ASC Open API spec. This is the default behavior on App Store Connect and does work with both Apple ID and API Token
224
- publicLinkEnabled: public_link_enabled,
225
- publicLinkLimit: public_link_limit,
226
- publicLinkLimitEnabled: public_link_limit_enabled
227
- },
225
+ attributes: attributes,
228
226
  relationships: {
229
227
  app: {
230
228
  data: {
@@ -125,7 +125,27 @@ module Spaceship
125
125
  end
126
126
 
127
127
  def write_key_to_file(path)
128
- File.open(path, 'w') { |f| f.write(@key_raw) }
128
+ return unless @key_raw.kind_of?(String)
129
+
130
+ lines = @key_raw.lines.map(&:chomp)
131
+
132
+ if lines.size == 3 && lines.first.include?("BEGIN") && lines.last.include?("END")
133
+ header = lines.first
134
+ footer = lines.last
135
+ raw_base64 = lines[1].gsub(/\s+/, "") # Remove any whitespace
136
+
137
+ # Rewrap base64 content at 64 characters per line
138
+ wrapped = raw_base64.scan(/.{1,64}/).join("\n")
139
+
140
+ File.open(path, 'w') do |f|
141
+ f.puts(header)
142
+ f.puts(wrapped)
143
+ f.puts(footer)
144
+ end
145
+ else
146
+ # Fall back to writing raw (likely already well-formatted)
147
+ File.write(path, @key_raw)
148
+ end
129
149
  end
130
150
  end
131
151
  end
@@ -1114,7 +1114,9 @@ module Spaceship
1114
1114
  }
1115
1115
  }
1116
1116
 
1117
- tunes_request_client.post("#{Version::V1}/appStoreVersionReleaseRequests", body)
1117
+ # App Store Connect can return a 500/504 after it has accepted the release request. A retry is then
1118
+ # rejected because the version is already being released, so leave it to the caller to check the version state
1119
+ tunes_request_client.post("#{Version::V1}/appStoreVersionReleaseRequests", body, tries: 1)
1118
1120
  end
1119
1121
 
1120
1122
  #
@@ -10,13 +10,13 @@ module Spaceship
10
10
 
11
11
  def process_response(env)
12
12
  env.body = parse(env.body)
13
+ rescue StandardError, SyntaxError => e
14
+ raise Faraday::ParsingError.new(e, env[:response])
13
15
  end
14
16
 
15
17
  def parse(body)
16
18
  require 'plist' unless Object.const_defined?("Plist")
17
19
  Plist.parse_xml(body.force_encoding("UTF-8"))
18
- rescue StandardError, SyntaxError => e
19
- raise Faraday::ParsingError.new(e, env)
20
20
  end
21
21
 
22
22
  def parse_response?(env)
@@ -336,7 +336,7 @@ module Spaceship
336
336
 
337
337
  def merchants(mac: false)
338
338
  paging do |page_number|
339
- r = request(:post, "account/#{platform_slug(mac)}/identifiers/listOMCs.action", {
339
+ r = request(:post, "account/ios/identifiers/listOMCs.action", {
340
340
  teamId: team_id,
341
341
  pageNumber: page_number,
342
342
  pageSize: page_size,
@@ -347,7 +347,7 @@ module Spaceship
347
347
  end
348
348
 
349
349
  def merchant_domains(merchant_id, mac: false)
350
- r = request(:post, "account/#{platform_slug(mac)}/identifiers/listDomainsForMerchant", {
350
+ r = request(:post, "account/ios/identifiers/listDomainsForMerchant", {
351
351
  merchantId: merchant_id,
352
352
  teamId: team_id
353
353
  })
@@ -355,7 +355,7 @@ module Spaceship
355
355
  end
356
356
 
357
357
  def merchant_domain_get_verification_file(domain_id, mac: false)
358
- r = request(:get, "account/#{platform_slug(mac)}/identifiers/downloadDomainVerificationFile", {
358
+ r = request(:get, "account/ios/identifiers/downloadDomainVerificationFile", {
359
359
  teamId: team_id,
360
360
  domainId: domain_id
361
361
  })
@@ -373,7 +373,7 @@ module Spaceship
373
373
  def merchant_domain_verify(domain_id, mac: false)
374
374
  ensure_csrf(Spaceship::Portal::Merchant)
375
375
 
376
- r = request(:post, "account/#{platform_slug(mac)}/identifiers/verifyDomain", {
376
+ r = request(:post, "account/ios/identifiers/verifyDomain", {
377
377
  domainId: domain_id,
378
378
  teamId: team_id
379
379
  })
@@ -383,7 +383,7 @@ module Spaceship
383
383
  def create_merchant_domain!(merchant_id, domain_name, mac: false)
384
384
  ensure_csrf(Spaceship::Portal::Merchant)
385
385
 
386
- r = request(:post, "account/#{platform_slug(mac)}/identifiers/registerDomain", {
386
+ r = request(:post, "account/ios/identifiers/registerDomain", {
387
387
  domainName: domain_name,
388
388
  merchantId: merchant_id,
389
389
  teamId: team_id
@@ -394,7 +394,7 @@ module Spaceship
394
394
  def delete_merchant_domain!(domain_id, merchant_id, mac: false)
395
395
  ensure_csrf(Spaceship::Portal::Merchant)
396
396
 
397
- r = request(:post, "account/#{platform_slug(mac)}/identifiers/removeDomain", {
397
+ r = request(:post, "account/ios/identifiers/removeDomain", {
398
398
  merchantId: merchant_id,
399
399
  domainId: domain_id,
400
400
  teamId: team_id
@@ -405,7 +405,7 @@ module Spaceship
405
405
  def create_merchant!(name, bundle_id, mac: false)
406
406
  ensure_csrf(Spaceship::Portal::Merchant)
407
407
 
408
- r = request(:post, "account/#{platform_slug(mac)}/identifiers/addOMC.action", {
408
+ r = request(:post, "account/ios/identifiers/addOMC.action", {
409
409
  name: name,
410
410
  identifier: bundle_id,
411
411
  teamId: team_id
@@ -416,7 +416,7 @@ module Spaceship
416
416
  def delete_merchant!(merchant_id, mac: false)
417
417
  ensure_csrf(Spaceship::Portal::Merchant)
418
418
 
419
- r = request(:post, "account/#{platform_slug(mac)}/identifiers/deleteOMC.action", {
419
+ r = request(:post, "account/ios/identifiers/deleteOMC.action", {
420
420
  teamId: team_id,
421
421
  omcId: merchant_id
422
422
  })
@@ -323,11 +323,7 @@ module Spaceship
323
323
  end
324
324
 
325
325
  def local_variable_get(binding, name)
326
- if binding.respond_to?(:local_variable_get)
327
- binding.local_variable_get(name)
328
- else
329
- binding.eval(name.to_s)
330
- end
326
+ binding.local_variable_get(name)
331
327
  end
332
328
 
333
329
  def provider_id
@@ -82,7 +82,7 @@ module Supply
82
82
 
83
83
  UI.verbose("Fetching a new access token from Google...")
84
84
 
85
- auth_client.fetch_access_token!
85
+ auth_client.apply!({}) # fetches the first token; fetch_access_token! is private on impersonated credentials
86
86
 
87
87
  if FastlaneCore::Env.truthy?("DEBUG")
88
88
  Google::Apis.logger.level = Logger::DEBUG
@@ -231,6 +231,12 @@ module Supply
231
231
  verify_block: proc do |value|
232
232
  UI.user_error!("Value must be one of '#{Supply::RELEASE_STATUS}'") unless Supply::ReleaseStatus::ALL.include?(value)
233
233
  end),
234
+ FastlaneCore::ConfigItem.new(key: :track_promote_force,
235
+ env_name: "SUPPLY_TRACK_PROMOTE_FORCE",
236
+ optional: true,
237
+ description: "Force the promotion of a version code that is no longer returned for the source track (:version_code and :version_name are required)",
238
+ type: Boolean,
239
+ default_value: false),
234
240
  FastlaneCore::ConfigItem.new(key: :validate_only,
235
241
  env_name: "SUPPLY_VALIDATE_ONLY",
236
242
  optional: true,
@@ -196,8 +196,11 @@ module Supply
196
196
  UI.user_error!("Cannot promote from track '#{Supply.config[:track]}' - track doesn't exist")
197
197
  end
198
198
 
199
- releases = track_from.releases
200
- if Supply.config[:version_code].to_s != ""
199
+ releases = track_from.releases || []
200
+
201
+ if Supply.config[:track_promote_force]
202
+ releases = [forced_track_release]
203
+ elsif Supply.config[:version_code].to_s != ""
201
204
  releases = releases.select do |release|
202
205
  release.version_codes.include?(Supply.config[:version_code].to_s)
203
206
  end
@@ -239,6 +242,29 @@ module Supply
239
242
  client.update_track(Supply.config[:track_promote_to], track_to)
240
243
  end
241
244
 
245
+ # Builds the release to promote instead of looking it up in the source track.
246
+ #
247
+ # The Play Developer API only returns the release currently serving each
248
+ # track, so a version that has already been superseded is absent from the
249
+ # payload and cannot be found by `promote_track`, even though the Play
250
+ # Console still allows promoting it. Building the release out of the
251
+ # configured values is the only way to promote such a version.
252
+ # See https://github.com/fastlane/fastlane/issues/18497
253
+ def forced_track_release
254
+ version_code = Supply.config[:version_code].to_s
255
+ version_name = Supply.config[:version_name].to_s
256
+
257
+ UI.user_error!("To force a track promotion, it is mandatory to enter the :version_code") if version_code.empty?
258
+ UI.user_error!("To force a track promotion, it is mandatory to enter the :version_name") if version_name.empty?
259
+
260
+ UI.important("Forcing the promotion of version code '#{version_code}' - it is not checked against track '#{Supply.config[:track]}'")
261
+
262
+ AndroidPublisher::TrackRelease.new(
263
+ name: version_name,
264
+ version_codes: [version_code]
265
+ )
266
+ end
267
+
242
268
  def upload_changelog(language, version_code)
243
269
  UI.user_error!("Cannot find changelog because no version code given - please specify :version_code") unless version_code
244
270
 
metadata CHANGED
@@ -1,36 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.241.1
4
+ version: 2.242.0
5
5
  platform: ruby
6
6
  authors:
7
- - Felix Krause
8
- - Jimmy Dee
9
7
  - Connor Tumbleson
10
- - Manish Rathi
11
- - Daniel Jankowski
12
- - Kohki Miki
13
- - Josh Holtz
14
- - Manu Wallner
15
- - Stefan Natchev
16
- - Olivier Halligon
17
- - Max Ott
8
+ - Felix Krause
9
+ - Matthew Ellis
10
+ - Danielle Tomlinson
11
+ - Roger Oba
18
12
  - Helmut Januschka
19
- - Luka Mirosevic
13
+ - Stefan Natchev
20
14
  - Satoshi Namai
21
- - Roger Oba
22
- - Danielle Tomlinson
15
+ - Jérôme Lacoste
16
+ - Manish Rathi
17
+ - Aaron Brager
23
18
  - Andrew McBurney
19
+ - Olivier Halligon
20
+ - Kohki Miki
24
21
  - Iulian Onofrei
25
- - Aaron Brager
22
+ - Max Ott
23
+ - Daniel Jankowski
24
+ - Łukasz Grabowski
25
+ - Josh Holtz
26
+ - Fumiya Nakamura
27
+ - Luka Mirosevic
26
28
  - Jan Piotrowski
27
- - Jérôme Lacoste
28
- - Jorge Revuelta H
29
- - Maksym Grebenets
29
+ - Jimmy Dee
30
30
  - Joshua Liebowitz
31
- - Fumiya Nakamura
32
- - Łukasz Grabowski
33
- - Matthew Ellis
31
+ - Manu Wallner
32
+ - Maksym Grebenets
33
+ - Jorge Revuelta H
34
34
  bindir: bin
35
35
  cert_chain: []
36
36
  date: 1980-01-02 00:00:00.000000000 Z
@@ -619,14 +619,14 @@ dependencies:
619
619
  requirements:
620
620
  - - "~>"
621
621
  - !ruby/object:Gem::Version
622
- version: '0.3'
622
+ version: '0.4'
623
623
  type: :runtime
624
624
  prerelease: false
625
625
  version_requirements: !ruby/object:Gem::Requirement
626
626
  requirements:
627
627
  - - "~>"
628
628
  - !ruby/object:Gem::Version
629
- version: '0.3'
629
+ version: '0.4'
630
630
  - !ruby/object:Gem::Dependency
631
631
  name: simctl
632
632
  requirement: !ruby/object:Gem::Requirement
@@ -999,6 +999,8 @@ files:
999
999
  - fastlane/lib/assets/DefaultFastfileTemplate
1000
1000
  - fastlane/lib/assets/DefaultFastfileTemplate.swift
1001
1001
  - fastlane/lib/assets/TeamTable.md.erb
1002
+ - fastlane/lib/assets/certificates/AppleIncRootCertificate.cer
1003
+ - fastlane/lib/assets/certificates/AppleRootCA-G3.cer
1002
1004
  - fastlane/lib/assets/completions/completion.bash
1003
1005
  - fastlane/lib/assets/completions/completion.fish
1004
1006
  - fastlane/lib/assets/completions/completion.sh
@@ -1128,10 +1130,10 @@ files:
1128
1130
  - fastlane/lib/fastlane/actions/hg_commit_version_bump.rb
1129
1131
  - fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
1130
1132
  - fastlane/lib/fastlane/actions/hg_push.rb
1131
- - fastlane/lib/fastlane/actions/hockey.rb
1132
1133
  - fastlane/lib/fastlane/actions/ifttt.rb
1133
1134
  - fastlane/lib/fastlane/actions/import.rb
1134
1135
  - fastlane/lib/fastlane/actions/import_certificate.rb
1136
+ - fastlane/lib/fastlane/actions/import_from_gem.rb
1135
1137
  - fastlane/lib/fastlane/actions/import_from_git.rb
1136
1138
  - fastlane/lib/fastlane/actions/increment_build_number.rb
1137
1139
  - fastlane/lib/fastlane/actions/increment_version_number.rb
@@ -1224,7 +1226,6 @@ files:
1224
1226
  - fastlane/lib/fastlane/actions/trainer.rb
1225
1227
  - fastlane/lib/fastlane/actions/tryouts.rb
1226
1228
  - fastlane/lib/fastlane/actions/twitter.rb
1227
- - fastlane/lib/fastlane/actions/typetalk.rb
1228
1229
  - fastlane/lib/fastlane/actions/unlock_keychain.rb
1229
1230
  - fastlane/lib/fastlane/actions/update_app_age_rating.rb
1230
1231
  - fastlane/lib/fastlane/actions/update_app_group_identifiers.rb
@@ -1432,6 +1433,7 @@ files:
1432
1433
  - fastlane_core/lib/fastlane_core/provisioning_profile.rb
1433
1434
  - fastlane_core/lib/fastlane_core/queue_worker.rb
1434
1435
  - fastlane_core/lib/fastlane_core/secrets.rb
1436
+ - fastlane_core/lib/fastlane_core/stored_passwords.rb
1435
1437
  - fastlane_core/lib/fastlane_core/string_filters.rb
1436
1438
  - fastlane_core/lib/fastlane_core/swag.rb
1437
1439
  - fastlane_core/lib/fastlane_core/tag_version.rb
@@ -1888,6 +1890,7 @@ metadata:
1888
1890
  changelog_uri: https://github.com/fastlane/fastlane/releases
1889
1891
  documentation_uri: https://docs.fastlane.tools/
1890
1892
  homepage_uri: https://fastlane.tools
1893
+ rubygems_mfa_required: 'true'
1891
1894
  source_code_uri: https://github.com/fastlane/fastlane
1892
1895
  rdoc_options: []
1893
1896
  require_paths: