fastlane 2.138.0 → 2.139.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +66 -66
  3. data/deliver/lib/deliver/submit_for_review.rb +7 -1
  4. data/fastlane/lib/fastlane/action.rb +1 -1
  5. data/fastlane/lib/fastlane/actions/create_pull_request.rb +42 -2
  6. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +10 -0
  7. data/fastlane/lib/fastlane/actions/last_git_tag.rb +14 -5
  8. data/fastlane/lib/fastlane/actions/setup_ci.rb +14 -8
  9. data/fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb +78 -0
  10. data/fastlane/lib/fastlane/version.rb +1 -1
  11. data/fastlane/swift/Deliverfile.swift +1 -1
  12. data/fastlane/swift/Fastlane.swift +64 -10
  13. data/fastlane/swift/Gymfile.swift +1 -1
  14. data/fastlane/swift/Matchfile.swift +1 -1
  15. data/fastlane/swift/Precheckfile.swift +1 -1
  16. data/fastlane/swift/Scanfile.swift +1 -1
  17. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  18. data/fastlane/swift/Screengrabfile.swift +1 -1
  19. data/fastlane/swift/Snapshotfile.swift +1 -1
  20. data/fastlane_core/lib/fastlane_core/build_watcher.rb +6 -2
  21. data/fastlane_core/lib/fastlane_core/device_manager.rb +20 -0
  22. data/fastlane_core/lib/fastlane_core/helper.rb +7 -1
  23. data/frameit/lib/frameit/editor.rb +3 -0
  24. data/gym/lib/gym/.runner.rb.swp +0 -0
  25. data/gym/lib/gym/generators/build_command_generator.rb +1 -0
  26. data/gym/lib/gym/runner.rb +8 -3
  27. data/pilot/lib/pilot/build_manager.rb +31 -6
  28. data/pilot/lib/pilot/options.rb +3 -1
  29. data/scan/lib/scan/options.rb +5 -0
  30. data/scan/lib/scan/runner.rb +6 -0
  31. data/spaceship/lib/spaceship/connect_api/models/build.rb +5 -0
  32. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +5 -0
  33. data/supply/lib/supply/client.rb +26 -0
  34. data/supply/lib/supply/uploader.rb +28 -0
  35. metadata +22 -20
@@ -39,17 +39,25 @@ module Pilot
39
39
 
40
40
  UI.success("Successfully uploaded the new binary to App Store Connect")
41
41
 
42
+ # We will fully skip waiting for build processing *only* if no changelog is supplied
43
+ # Otherwise we may partially wait until the build appears so the changelog can be set, and then bail.
44
+ return_when_build_appears = false
42
45
  if config[:skip_waiting_for_build_processing]
43
- UI.important("Skip waiting for build processing")
44
- UI.important("This means that no changelog will be set and no build will be distributed to testers")
45
- return
46
+ if config[:changelog].nil?
47
+ UI.important("`skip_waiting_for_build_processing` used and no `changelog` supplied - skipping waiting for build processing")
48
+ return
49
+ else
50
+ return_when_build_appears = true
51
+ end
46
52
  end
47
53
 
48
54
  # Calling login again here is needed if login was not called during 'start'
49
55
  login unless should_login_in_start
50
56
 
51
57
  UI.message("If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option")
52
- latest_build = wait_for_build_processing_to_be_complete
58
+ UI.message("Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps.")
59
+
60
+ latest_build = wait_for_build_processing_to_be_complete(return_when_build_appears)
53
61
  distribute(options, build: latest_build)
54
62
  end
55
63
 
@@ -80,11 +88,20 @@ module Pilot
80
88
  end
81
89
  end
82
90
 
83
- def wait_for_build_processing_to_be_complete
91
+ def wait_for_build_processing_to_be_complete(return_when_build_appears = false)
84
92
  platform = fetch_app_platform
85
93
  app_version = FastlaneCore::IpaFileAnalyser.fetch_app_version(config[:ipa])
86
94
  app_build = FastlaneCore::IpaFileAnalyser.fetch_app_build(config[:ipa])
87
- latest_build = FastlaneCore::BuildWatcher.wait_for_build_processing_to_be_complete(app_id: app.id, platform: platform, app_version: app_version, build_version: app_build, poll_interval: config[:wait_processing_interval], return_spaceship_testflight_build: false)
95
+
96
+ latest_build = FastlaneCore::BuildWatcher.wait_for_build_processing_to_be_complete(
97
+ app_id: app.id,
98
+ platform: platform,
99
+ app_version: app_version,
100
+ build_version: app_build,
101
+ poll_interval: config[:wait_processing_interval],
102
+ return_when_build_appears: return_when_build_appears,
103
+ return_spaceship_testflight_build: false
104
+ )
88
105
 
89
106
  unless latest_build.app_version == app_version && latest_build.version == app_build
90
107
  UI.important("Uploaded app #{app_version} - #{app_build}, but received build #{latest_build.app_version} - #{latest_build.version}.")
@@ -137,6 +154,14 @@ module Pilot
137
154
  UI.success("Deleted beta app review submission for previous build: #{waiting_for_review_build.app_version} - #{waiting_for_review_build.version}")
138
155
  end
139
156
  end
157
+
158
+ if !build.ready_for_internal_testing? && options[:skip_waiting_for_build_processing]
159
+ # Meta can be uploaded for a build still in processing
160
+ # Returning before distribute if skip_waiting_for_build_processing
161
+ # because can't distribute an app that is still processing
162
+ return
163
+ end
164
+
140
165
  distribute_build(build, options)
141
166
  type = options[:distribute_external] ? 'External' : 'Internal'
142
167
  UI.success("Successfully distributed build to #{type} testers 🚀")
@@ -132,7 +132,9 @@ module Pilot
132
132
  FastlaneCore::ConfigItem.new(key: :skip_waiting_for_build_processing,
133
133
  short_option: "-z",
134
134
  env_name: "PILOT_SKIP_WAITING_FOR_BUILD_PROCESSING",
135
- description: "Don't wait for the build to process. If set to true, the changelog won't be set, `distribute_external` option won't work and no build will be distributed to testers. (You might want to use this option if you are using this action on CI and have to pay for 'minutes used' on your CI plan)",
135
+ description: "If set to true, the `distribute_external` option won't work and no build will be distributed to testers. " \
136
+ "(You might want to use this option if you are using this action on CI and have to pay for 'minutes used' on your CI plan). " \
137
+ "If set to `true` and a changelog is provided, it will partially wait for the build to appear on AppStore Connect so the changelog can be set, and skip the remaining processing steps",
136
138
  is_string: false,
137
139
  default_value: false),
138
140
  FastlaneCore::ConfigItem.new(key: :update_build_info_on_upload,
@@ -81,6 +81,11 @@ module Scan
81
81
  description: "Enabling this option will automatically erase the simulator before running the application",
82
82
  default_value: false,
83
83
  type: Boolean),
84
+ FastlaneCore::ConfigItem.new(key: :disable_slide_to_type,
85
+ env_name: 'SCAN_DISABLE_SLIDE_TO_TYPE',
86
+ description: "Enabling this option will disable the simulator from showing the 'Slide to type' prompt",
87
+ default_value: true,
88
+ type: Boolean),
84
89
  FastlaneCore::ConfigItem.new(key: :prelaunch_simulator,
85
90
  env_name: 'SCAN_PRELAUNCH_SIMULATOR',
86
91
  description: "Enabling this option will launch the first simulator prior to calling any xcodebuild command",
@@ -31,6 +31,12 @@ module Scan
31
31
  end
32
32
  end
33
33
 
34
+ if Scan.config[:disable_slide_to_type]
35
+ Scan.devices.each do |device|
36
+ FastlaneCore::Simulator.disable_slide_to_type(udid: device.udid)
37
+ end
38
+ end
39
+
34
40
  # We call this method, to be sure that all other simulators are killed
35
41
  # And a correct one is freshly launched. Switching between multiple simulator
36
42
  # in case the user specified multiple targets works with no issues
@@ -78,6 +78,11 @@ module Spaceship
78
78
  return processing_state != ProcessingState::PROCESSING
79
79
  end
80
80
 
81
+ def ready_for_internal_testing?
82
+ raise "No build_beta_detail included" unless build_beta_detail
83
+ return build_beta_detail.ready_for_internal_testing?
84
+ end
85
+
81
86
  def ready_for_beta_submission?
82
87
  raise "No build_beta_detail included" unless build_beta_detail
83
88
  return build_beta_detail.ready_for_beta_submission?
@@ -10,6 +10,7 @@ module Spaceship
10
10
  attr_accessor :external_build_state
11
11
 
12
12
  module InternalState
13
+ PROCESSING = "PROCESSING"
13
14
  PROCESSING_EXCEPTION = "PROCESSING_EXCEPTION"
14
15
  MISSING_EXPORT_COMPLIANCE = "MISSING_EXPORT_COMPLIANCE"
15
16
  READY_FOR_BETA_TESTING = "READY_FOR_BETA_TESTING"
@@ -47,6 +48,10 @@ module Spaceship
47
48
  #
48
49
  # Helpers
49
50
  #
51
+ #
52
+ def ready_for_internal_testing?
53
+ return internal_build_state == InternalState::READY_FOR_BETA_TESTING
54
+ end
50
55
 
51
56
  def ready_for_beta_submission?
52
57
  return external_build_state == ExternalState::READY_FOR_BETA_SUBMISSION
@@ -310,6 +310,19 @@ module Supply
310
310
  return result_upload.version_code
311
311
  end
312
312
 
313
+ def upload_apk_to_internal_app_sharing(package_name, path_to_apk)
314
+ # NOTE: This Google API is a little different. It doesn't require an active edit.
315
+ result_upload = call_google_api do
316
+ client.uploadapk_internalappsharingartifact(
317
+ package_name,
318
+ upload_source: path_to_apk,
319
+ content_type: "application/octet-stream"
320
+ )
321
+ end
322
+
323
+ return result_upload.download_url
324
+ end
325
+
313
326
  def upload_mapping(path_to_mapping, apk_version_code)
314
327
  ensure_active_edit!
315
328
 
@@ -340,6 +353,19 @@ module Supply
340
353
  return result_upload.version_code
341
354
  end
342
355
 
356
+ def upload_bundle_to_internal_app_sharing(package_name, path_to_aab)
357
+ # NOTE: This Google API is a little different. It doesn't require an active edit.
358
+ result_upload = call_google_api do
359
+ client.uploadbundle_internalappsharingartifact(
360
+ package_name,
361
+ upload_source: path_to_aab,
362
+ content_type: "application/octet-stream"
363
+ )
364
+ end
365
+
366
+ return result_upload.download_url
367
+ end
368
+
343
369
  # Get a list of all tracks - returns the list
344
370
  def tracks(*tracknames)
345
371
  ensure_active_edit!
@@ -42,6 +42,34 @@ module Supply
42
42
  end
43
43
  end
44
44
 
45
+ def perform_upload_to_internal_app_sharing
46
+ download_urls = []
47
+
48
+ package_name = Supply.config[:package_name]
49
+
50
+ apk_paths = [Supply.config[:apk]] unless (apk_paths = Supply.config[:apk_paths])
51
+ apk_paths.compact!
52
+ apk_paths.each do |apk_path|
53
+ download_url = client.upload_apk_to_internal_app_sharing(package_name, apk_path)
54
+ download_urls << download_url
55
+ UI.success("Successfully uploaded APK to Internal App Sharing URL: #{download_url}")
56
+ end
57
+
58
+ aab_paths = [Supply.config[:aab]] unless (aab_paths = Supply.config[:aab_paths])
59
+ aab_paths.compact!
60
+ aab_paths.each do |aab_path|
61
+ download_url = client.upload_bundle_to_internal_app_sharing(package_name, aab_path)
62
+ download_urls << download_url
63
+ UI.success("Successfully uploaded AAB to Internal App Sharing URL: #{download_url}")
64
+ end
65
+
66
+ if download_urls.count == 1
67
+ return download_urls.first
68
+ else
69
+ return download_urls
70
+ end
71
+ end
72
+
45
73
  def perform_upload_meta(version_codes)
46
74
  if (!Supply.config[:skip_upload_metadata] || !Supply.config[:skip_upload_images] || !Supply.config[:skip_upload_changelogs] || !Supply.config[:skip_upload_screenshots]) && metadata_path
47
75
  # Use version code from config if version codes is empty and no nil or empty string
metadata CHANGED
@@ -1,33 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.138.0
4
+ version: 2.139.0
5
5
  platform: ruby
6
6
  authors:
7
- - Jorge Revuelta H
8
- - Joshua Liebowitz
9
- - Josh Holtz
10
- - Danielle Tomlinson
11
7
  - Kohki Miki
12
- - Luka Mirosevic
8
+ - Josh Holtz
9
+ - Helmut Januschka
10
+ - Jorge Revuelta H
11
+ - Jimmy Dee
12
+ - Jérôme Lacoste
13
13
  - Iulian Onofrei
14
- - Stefan Natchev
15
- - Maksym Grebenets
16
14
  - Manu Wallner
15
+ - Stefan Natchev
16
+ - Andrew McBurney
17
+ - Jan Piotrowski
18
+ - Felix Krause
19
+ - Danielle Tomlinson
17
20
  - Aaron Brager
21
+ - Joshua Liebowitz
18
22
  - Matthew Ellis
19
- - Felix Krause
20
- - Jan Piotrowski
21
- - Jérôme Lacoste
22
- - Helmut Januschka
23
- - Fumiya Nakamura
24
- - Andrew McBurney
23
+ - Maksym Grebenets
24
+ - Luka Mirosevic
25
25
  - Olivier Halligon
26
- - Jimmy Dee
26
+ - Fumiya Nakamura
27
27
  autorequire:
28
28
  bindir: bin
29
29
  cert_chain: []
30
- date: 2019-12-19 00:00:00.000000000 Z
30
+ date: 2019-12-30 00:00:00.000000000 Z
31
31
  dependencies:
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: slack-notifier
@@ -611,20 +611,20 @@ dependencies:
611
611
  requirements:
612
612
  - - ">="
613
613
  - !ruby/object:Gem::Version
614
- version: 0.21.2
614
+ version: 0.29.2
615
615
  - - "<"
616
616
  - !ruby/object:Gem::Version
617
- version: 0.24.0
617
+ version: 0.37.0
618
618
  type: :runtime
619
619
  prerelease: false
620
620
  version_requirements: !ruby/object:Gem::Requirement
621
621
  requirements:
622
622
  - - ">="
623
623
  - !ruby/object:Gem::Version
624
- version: 0.21.2
624
+ version: 0.29.2
625
625
  - - "<"
626
626
  - !ruby/object:Gem::Version
627
- version: 0.24.0
627
+ version: 0.37.0
628
628
  - !ruby/object:Gem::Dependency
629
629
  name: google-cloud-storage
630
630
  requirement: !ruby/object:Gem::Requirement
@@ -1206,6 +1206,7 @@ files:
1206
1206
  - fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb
1207
1207
  - fastlane/lib/fastlane/actions/upload_to_app_store.rb
1208
1208
  - fastlane/lib/fastlane/actions/upload_to_play_store.rb
1209
+ - fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb
1209
1210
  - fastlane/lib/fastlane/actions/upload_to_testflight.rb
1210
1211
  - fastlane/lib/fastlane/actions/validate_play_store_json_key.rb
1211
1212
  - fastlane/lib/fastlane/actions/verify_build.rb
@@ -1420,6 +1421,7 @@ files:
1420
1421
  - gym/lib/assets/GymfileTemplate.swift
1421
1422
  - gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh
1422
1423
  - gym/lib/gym.rb
1424
+ - gym/lib/gym/.runner.rb.swp
1423
1425
  - gym/lib/gym/code_signing_mapping.rb
1424
1426
  - gym/lib/gym/commands_generator.rb
1425
1427
  - gym/lib/gym/detect_values.rb