fastlane 2.203.0 → 2.204.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +96 -96
  3. data/fastlane/lib/fastlane/actions/trainer.rb +2 -2
  4. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
  5. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +1 -1
  6. data/fastlane/lib/fastlane/swift_lane_manager.rb +11 -3
  7. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +55 -1
  8. data/fastlane/lib/fastlane/version.rb +1 -1
  9. data/fastlane/swift/Atomic.swift +150 -0
  10. data/fastlane/swift/Deliverfile.swift +1 -1
  11. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  12. data/fastlane/swift/Fastlane.swift +31 -7
  13. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +30 -20
  14. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +1 -1
  15. data/fastlane/swift/Gymfile.swift +1 -1
  16. data/fastlane/swift/GymfileProtocol.swift +2 -2
  17. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  18. data/fastlane/swift/Matchfile.swift +1 -1
  19. data/fastlane/swift/MatchfileProtocol.swift +6 -2
  20. data/fastlane/swift/Precheckfile.swift +1 -1
  21. data/fastlane/swift/PrecheckfileProtocol.swift +2 -2
  22. data/fastlane/swift/Runner.swift +9 -1
  23. data/fastlane/swift/Scanfile.swift +1 -1
  24. data/fastlane/swift/ScanfileProtocol.swift +2 -2
  25. data/fastlane/swift/Screengrabfile.swift +1 -1
  26. data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
  27. data/fastlane/swift/Snapshotfile.swift +1 -1
  28. data/fastlane/swift/SnapshotfileProtocol.swift +2 -2
  29. data/fastlane/swift/SocketClient.swift +5 -1
  30. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  31. data/fastlane/swift/formatting/Brewfile.lock.json +8 -8
  32. data/fastlane/swift/upgrade_manifest.json +1 -1
  33. data/fastlane_core/lib/fastlane_core/device_manager.rb +5 -1
  34. data/match/lib/match/nuke.rb +33 -9
  35. data/match/lib/match/options.rb +5 -0
  36. data/match/lib/match/storage/s3_storage.rb +3 -3
  37. data/pilot/lib/pilot/build_manager.rb +17 -7
  38. data/pilot/lib/pilot/options.rb +6 -1
  39. data/scan/lib/scan/runner.rb +4 -4
  40. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +5 -1
  41. metadata +20 -22
  42. data/fastlane_core/lib/fastlane_core/.helper.rb.swp +0 -0
  43. data/scan/lib/scan/.detect_values.rb.swp +0 -0
  44. data/scan/lib/scan/.runner.rb.swp +0 -0
@@ -320,7 +320,11 @@ module FastlaneCore
320
320
  UI.verbose("Uninstalling app '#{app_identifier}' from #{device_type}...")
321
321
 
322
322
  UI.message("Launch Simulator #{device_type}")
323
- Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")
323
+ if FastlaneCore::Helper.xcode_at_least?("13")
324
+ Helper.backticks("open -a Simulator.app --args -CurrentDeviceUDID #{device_udid} &> /dev/null")
325
+ else
326
+ Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")
327
+ end
324
328
 
325
329
  UI.message("Uninstall application #{app_identifier}")
326
330
  Helper.backticks("xcrun simctl uninstall #{device_udid} #{app_identifier} &> /dev/null")
@@ -18,6 +18,7 @@ module Match
18
18
  attr_accessor :params
19
19
  attr_accessor :type
20
20
 
21
+ attr_accessor :safe_remove_certs
21
22
  attr_accessor :certs
22
23
  attr_accessor :profiles
23
24
  attr_accessor :files
@@ -70,6 +71,8 @@ module Match
70
71
  hide_keys: [:app_identifier],
71
72
  title: "Summary for match nuke #{Fastlane::VERSION}")
72
73
 
74
+ self.safe_remove_certs = params[:safe_remove_certs] || false
75
+
73
76
  prepare_list
74
77
  filter_by_cert
75
78
  print_tables
@@ -81,11 +84,13 @@ module Match
81
84
  if (self.certs + self.profiles + self.files).count > 0
82
85
  unless params[:skip_confirmation]
83
86
  UI.error("---")
84
- UI.error("Are you sure you want to completely delete and revoke all the")
85
- UI.error("certificates and provisioning profiles listed above? (y/n)")
87
+ remove_or_revoke_message = self.safe_remove_certs ? "remove" : "revoke"
88
+ UI.error("Are you sure you want to completely delete and #{remove_or_revoke_message} all the")
89
+ UI.error("certificates and delete provisioning profiles listed above? (y/n)")
86
90
  UI.error("Warning: By nuking distribution, both App Store and Ad Hoc profiles will be deleted") if type == "distribution"
87
91
  UI.error("Warning: The :app_identifier value will be ignored - this will delete all profiles for all your apps!") if had_app_identifier
88
92
  UI.error("---")
93
+ print_safe_remove_certs_hint
89
94
  end
90
95
  if params[:skip_confirmation] || UI.confirm("Do you really want to nuke everything listed above?")
91
96
  nuke_it_now!
@@ -119,10 +124,12 @@ module Match
119
124
  if Spaceship::ConnectAPI.client.in_house? && (type == "distribution" || type == "enterprise")
120
125
  UI.error("---")
121
126
  UI.error("⚠️ Warning: This seems to be an Enterprise account!")
122
- UI.error("By nuking your account's distribution, all your apps deployed via ad-hoc will stop working!") if type == "distribution"
123
- UI.error("By nuking your account's enterprise, all your in-house apps will stop working!") if type == "enterprise"
127
+ unless self.safe_remove_certs
128
+ UI.error("By nuking your account's distribution, all your apps deployed via ad-hoc will stop working!") if type == "distribution"
129
+ UI.error("By nuking your account's enterprise, all your in-house apps will stop working!") if type == "enterprise"
130
+ end
124
131
  UI.error("---")
125
-
132
+ print_safe_remove_certs_hint
126
133
  UI.user_error!("Enterprise account nuke cancelled") unless UI.confirm("Do you really want to nuke your Enterprise account?")
127
134
  end
128
135
  end
@@ -168,7 +175,7 @@ module Match
168
175
  keys += self.storage.list_files(file_name: ct.to_s, file_ext: "p12")
169
176
  end
170
177
 
171
- # Finds all the iOS and macOS profofiles in the file storage
178
+ # Finds all the iOS and macOS profiles in the file storage
172
179
  profiles = []
173
180
  prov_types.each do |prov_type|
174
181
  profiles += self.storage.list_files(file_name: prov_type.to_s, file_ext: "mobileprovision")
@@ -190,7 +197,7 @@ module Match
190
197
  [i + 1, cert.name, cert.id, cert.class.to_s.split("::").last, cert_expiration]
191
198
  end
192
199
  puts(Terminal::Table.new({
193
- title: "Certificates that can be revoked".green,
200
+ title: "Certificates that can be #{removed_or_revoked_message}".green,
194
201
  headings: ["Option", "Name", "ID", "Type", "Expires"],
195
202
  rows: FastlaneCore::PrintTable.transform_output(rows)
196
203
  }))
@@ -259,7 +266,7 @@ module Match
259
266
  [cert.name, cert.id, cert.class.to_s.split("::").last, cert_expiration]
260
267
  end
261
268
  puts(Terminal::Table.new({
262
- title: "Certificates that are going to be revoked".green,
269
+ title: "Certificates that are going to be #{removed_or_revoked_message}".green,
263
270
  headings: ["Name", "ID", "Type", "Expires"],
264
271
  rows: FastlaneCore::PrintTable.transform_output(rows)
265
272
  }))
@@ -313,8 +320,14 @@ module Match
313
320
  UI.success("Successfully deleted profile")
314
321
  end
315
322
 
316
- UI.header("Revoking #{self.certs.count} certificates...") unless self.certs.count == 0
323
+ removing_or_revoking_message = self.safe_remove_certs ? "Removing" : "Revoking"
324
+ UI.header("#{removing_or_revoking_message} #{self.certs.count} certificates...") unless self.certs.count == 0
317
325
  self.certs.each do |cert|
326
+ if self.safe_remove_certs
327
+ UI.message("Certificate '#{cert.name}' (#{cert.id}) will be removed from repository without revoking it")
328
+ next
329
+ end
330
+
318
331
  UI.message("Revoking certificate '#{cert.name}' (#{cert.id})...")
319
332
  begin
320
333
  cert.delete!
@@ -427,6 +440,17 @@ module Match
427
440
  raise "Unknown provisioning type '#{prov_type}'"
428
441
  end
429
442
  end
443
+
444
+ # Helpers for `safe_remove_certs`
445
+ def print_safe_remove_certs_hint
446
+ return if self.safe_remove_certs
447
+ UI.important("Hint: You can use --safe_remove_certs option to remove certificates")
448
+ UI.important("from repository without revoking them.")
449
+ end
450
+
451
+ def removed_or_revoked_message
452
+ self.safe_remove_certs ? "removed" : "revoked"
453
+ end
430
454
  end
431
455
  # rubocop:disable Metrics/ClassLength
432
456
  end
@@ -257,6 +257,11 @@ module Match
257
257
  description: "Disables confirmation prompts during nuke, answering them with yes",
258
258
  type: Boolean,
259
259
  default_value: false),
260
+ FastlaneCore::ConfigItem.new(key: :safe_remove_certs,
261
+ env_name: "MATCH_SAFE_REMOVE_CERTS",
262
+ description: "Remove certs from repository during nuke without revoking them on the developer portal",
263
+ type: Boolean,
264
+ default_value: false),
260
265
  FastlaneCore::ConfigItem.new(key: :skip_docs,
261
266
  env_name: "MATCH_SKIP_DOCS",
262
267
  description: "Skip generation of a README.md for the created git repository",
@@ -168,10 +168,10 @@ module Match
168
168
  private
169
169
 
170
170
  def s3_object_path(file_name)
171
- santized = sanitize_file_name(file_name)
172
- return santized if santized.start_with?(s3_object_prefix)
171
+ sanitized = sanitize_file_name(file_name)
172
+ return sanitized if sanitized.start_with?(s3_object_prefix)
173
173
 
174
- s3_object_prefix + santized
174
+ s3_object_prefix + sanitized
175
175
  end
176
176
 
177
177
  def strip_s3_object_prefix(object_path)
@@ -18,6 +18,11 @@ module Pilot
18
18
 
19
19
  UI.user_error!("No ipa or pkg file given") if config[:ipa].nil? && config[:pkg].nil?
20
20
 
21
+ if config[:ipa] && config[:pkg]
22
+ UI.important("WARNING: Both `ipa` and `pkg` options are defined either explicitly or with default_value (build found in directory)")
23
+ UI.important("Uploading `ipa` is preferred by default. Set `app_platform` to `osx` to force uploading `pkg`")
24
+ end
25
+
21
26
  check_for_changelog_or_whats_new!(options)
22
27
 
23
28
  UI.success("Ready to upload new build to TestFlight (App: #{fetch_app_id})...")
@@ -25,24 +30,29 @@ module Pilot
25
30
  dir = Dir.mktmpdir
26
31
 
27
32
  platform = fetch_app_platform
28
- if options[:ipa]
33
+ ipa_path = options[:ipa]
34
+ if ipa_path && platform != 'osx'
35
+ asset_path = ipa_path
29
36
  package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(app_id: fetch_app_id,
30
- ipa_path: options[:ipa],
37
+ ipa_path: ipa_path,
31
38
  package_path: dir,
32
39
  platform: platform)
33
40
  else
41
+ pkg_path = options[:pkg]
42
+ asset_path = pkg_path
34
43
  package_path = FastlaneCore::PkgUploadPackageBuilder.new.generate(app_id: fetch_app_id,
35
- pkg_path: options[:pkg],
44
+ pkg_path: pkg_path,
36
45
  package_path: dir,
37
46
  platform: platform)
38
47
  end
39
48
 
40
49
  transporter = transporter_for_selected_team(options)
41
- result = transporter.upload(package_path: package_path, asset_path: options[:ipa] || options[:pkg])
50
+ result = transporter.upload(package_path: package_path, asset_path: asset_path)
42
51
 
43
52
  unless result
44
53
  transporter_errors = transporter.displayable_errors
45
- UI.user_error!("Error uploading ipa file: \n #{transporter_errors}")
54
+ file_type = platform == "osx" ? "pkg" : "ipa"
55
+ UI.user_error!("Error uploading #{file_type} file: \n #{transporter_errors}")
46
56
  end
47
57
 
48
58
  UI.success("Successfully uploaded the new binary to App Store Connect")
@@ -98,7 +108,7 @@ module Pilot
98
108
 
99
109
  def wait_for_build_processing_to_be_complete(return_when_build_appears = false)
100
110
  platform = fetch_app_platform
101
- if config[:ipa]
111
+ if config[:ipa] && platform != "osx"
102
112
  app_version = FastlaneCore::IpaFileAnalyser.fetch_app_version(config[:ipa])
103
113
  app_build = FastlaneCore::IpaFileAnalyser.fetch_app_build(config[:ipa])
104
114
  elsif config[:pkg]
@@ -410,7 +420,7 @@ module Pilot
410
420
  # This is where we could add a check to see if encryption is required and has been updated
411
421
  uploaded_build = set_export_compliance_if_needed(uploaded_build, options)
412
422
 
413
- if options[:groups] || options[:distribute_external]
423
+ if options[:submit_beta_review] && (options[:groups] || options[:distribute_external])
414
424
  if uploaded_build.ready_for_beta_submission?
415
425
  uploaded_build.post_beta_app_review_submission
416
426
  else
@@ -324,7 +324,12 @@ module Pilot
324
324
  env_name: "PILOT_REJECT_PREVIOUS_BUILD",
325
325
  description: "Expire previous if it's 'waiting for review'",
326
326
  is_string: false,
327
- default_value: false)
327
+ default_value: false),
328
+ FastlaneCore::ConfigItem.new(key: :submit_beta_review,
329
+ env_name: "PILOT_DISTRIBUTE_EXTERNAL",
330
+ description: "Send the build for a beta review",
331
+ type: Boolean,
332
+ default_value: true)
328
333
  ]
329
334
  end
330
335
  end
@@ -257,6 +257,10 @@ module Scan
257
257
  end
258
258
 
259
259
  def handle_results(tests_exit_status)
260
+ copy_simulator_logs
261
+ zip_build_products
262
+ copy_xctestrun
263
+
260
264
  return nil if Scan.config[:build_for_testing]
261
265
 
262
266
  results = trainer_test_results
@@ -294,10 +298,6 @@ module Scan
294
298
  }))
295
299
  puts("")
296
300
 
297
- copy_simulator_logs
298
- zip_build_products
299
- copy_xctestrun
300
-
301
301
  if number_of_failures > 0
302
302
  open_report
303
303
 
@@ -94,7 +94,11 @@ module Snapshot
94
94
  device_udid = TestCommandGenerator.device_udid(device_type)
95
95
 
96
96
  UI.message("Launch Simulator #{device_type}")
97
- Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")
97
+ if FastlaneCore::Helper.xcode_at_least?("13")
98
+ Helper.backticks("open -a Simulator.app --args -CurrentDeviceUDID #{device_udid} &> /dev/null")
99
+ else
100
+ Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")
101
+ end
98
102
 
99
103
  paths.each do |path|
100
104
  UI.message("Adding '#{path}'")
metadata CHANGED
@@ -1,39 +1,39 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.203.0
4
+ version: 2.204.0
5
5
  platform: ruby
6
6
  authors:
7
- - Jimmy Dee
8
- - Felix Krause
9
- - Maksym Grebenets
10
- - Fumiya Nakamura
11
- - Matthew Ellis
12
- - Jérôme Lacoste
7
+ - Roger Oba
13
8
  - Iulian Onofrei
14
9
  - Kohki Miki
10
+ - Maksym Grebenets
11
+ - Luka Mirosevic
12
+ - Josh Holtz
13
+ - Max Ott
14
+ - Aaron Brager
15
+ - Danielle Tomlinson
15
16
  - Olivier Halligon
16
- - Roger Oba
17
- - Helmut Januschka
18
- - Łukasz Grabowski
19
17
  - Andrew McBurney
18
+ - Jan Piotrowski
19
+ - Jimmy Dee
20
20
  - Manu Wallner
21
+ - Jérôme Lacoste
22
+ - Helmut Januschka
23
+ - Łukasz Grabowski
21
24
  - Stefan Natchev
25
+ - Fumiya Nakamura
26
+ - Felix Krause
27
+ - Jorge Revuelta H
22
28
  - Joshua Liebowitz
23
- - Manish Rathi
24
29
  - Satoshi Namai
25
- - Josh Holtz
26
- - Jorge Revuelta H
27
- - Max Ott
28
- - Aaron Brager
30
+ - Matthew Ellis
31
+ - Manish Rathi
29
32
  - Daniel Jankowski
30
- - Danielle Tomlinson
31
- - Luka Mirosevic
32
- - Jan Piotrowski
33
33
  autorequire:
34
34
  bindir: bin
35
35
  cert_chain: []
36
- date: 2022-01-28 00:00:00.000000000 Z
36
+ date: 2022-02-02 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: xcodeproj
@@ -1354,6 +1354,7 @@ files:
1354
1354
  - fastlane/swift/Actions.swift
1355
1355
  - fastlane/swift/Appfile.swift
1356
1356
  - fastlane/swift/ArgumentProcessor.swift
1357
+ - fastlane/swift/Atomic.swift
1357
1358
  - fastlane/swift/ControlCommand.swift
1358
1359
  - fastlane/swift/Deliverfile.swift
1359
1360
  - fastlane/swift/DeliverfileProtocol.swift
@@ -1395,7 +1396,6 @@ files:
1395
1396
  - fastlane_core/README.md
1396
1397
  - fastlane_core/lib/assets/XMLTemplate.xml.erb
1397
1398
  - fastlane_core/lib/fastlane_core.rb
1398
- - fastlane_core/lib/fastlane_core/.helper.rb.swp
1399
1399
  - fastlane_core/lib/fastlane_core/analytics/action_completion_context.rb
1400
1400
  - fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb
1401
1401
  - fastlane_core/lib/fastlane_core/analytics/analytics_event_builder.rb
@@ -1578,8 +1578,6 @@ files:
1578
1578
  - scan/lib/assets/ScanfileTemplate
1579
1579
  - scan/lib/assets/ScanfileTemplate.swift
1580
1580
  - scan/lib/scan.rb
1581
- - scan/lib/scan/.detect_values.rb.swp
1582
- - scan/lib/scan/.runner.rb.swp
1583
1581
  - scan/lib/scan/commands_generator.rb
1584
1582
  - scan/lib/scan/detect_values.rb
1585
1583
  - scan/lib/scan/error_handler.rb
Binary file
Binary file