fastlane 2.136.0 → 2.141.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +85 -72
  3. data/cert/lib/cert/options.rb +12 -5
  4. data/cert/lib/cert/runner.rb +13 -0
  5. data/deliver/lib/deliver/options.rb +2 -2
  6. data/deliver/lib/deliver/runner.rb +13 -2
  7. data/deliver/lib/deliver/submit_for_review.rb +7 -1
  8. data/fastlane/lib/fastlane/action.rb +2 -2
  9. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +1 -1
  10. data/fastlane/lib/fastlane/actions/build_app.rb +157 -6
  11. data/fastlane/lib/fastlane/actions/build_ios_app.rb +28 -132
  12. data/fastlane/lib/fastlane/actions/build_mac_app.rb +46 -0
  13. data/fastlane/lib/fastlane/actions/create_pull_request.rb +71 -2
  14. data/fastlane/lib/fastlane/actions/docs/{build_ios_app.md → build_app.md} +1 -1
  15. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +19 -0
  16. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +10 -0
  17. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +4 -2
  18. data/fastlane/lib/fastlane/actions/ensure_bundle_exec.rb +3 -3
  19. data/fastlane/lib/fastlane/actions/get_version_number.rb +7 -2
  20. data/fastlane/lib/fastlane/actions/gradle.rb +54 -3
  21. data/fastlane/lib/fastlane/actions/gym.rb +3 -7
  22. data/fastlane/lib/fastlane/actions/import_from_git.rb +4 -0
  23. data/fastlane/lib/fastlane/actions/increment_version_number.rb +6 -3
  24. data/fastlane/lib/fastlane/actions/last_git_tag.rb +14 -5
  25. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +2 -2
  26. data/fastlane/lib/fastlane/actions/register_devices.rb +5 -1
  27. data/fastlane/lib/fastlane/actions/ruby_version.rb +1 -1
  28. data/fastlane/lib/fastlane/actions/run_tests.rb +5 -22
  29. data/fastlane/lib/fastlane/actions/set_github_release.rb +1 -1
  30. data/fastlane/lib/fastlane/actions/setup_ci.rb +14 -8
  31. data/fastlane/lib/fastlane/actions/testfairy.rb +8 -1
  32. data/fastlane/lib/fastlane/actions/update_plist.rb +37 -2
  33. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +1 -0
  34. data/fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb +78 -0
  35. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
  36. data/fastlane/lib/fastlane/actions/xcode_select.rb +6 -1
  37. data/fastlane/lib/fastlane/cli_tools_distributor.rb +2 -2
  38. data/fastlane/lib/fastlane/commands_generator.rb +1 -1
  39. data/fastlane/lib/fastlane/fast_file.rb +13 -3
  40. data/fastlane/lib/fastlane/helper/adb_helper.rb +13 -4
  41. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -0
  42. data/fastlane/lib/fastlane/runner.rb +23 -18
  43. data/fastlane/lib/fastlane/version.rb +1 -1
  44. data/fastlane/swift/Deliverfile.swift +1 -1
  45. data/fastlane/swift/DeliverfileProtocol.swift +3 -3
  46. data/fastlane/swift/Fastlane.swift +342 -66
  47. data/fastlane/swift/Gymfile.swift +1 -1
  48. data/fastlane/swift/GymfileProtocol.swift +17 -1
  49. data/fastlane/swift/Matchfile.swift +1 -1
  50. data/fastlane/swift/MatchfileProtocol.swift +12 -4
  51. data/fastlane/swift/Precheckfile.swift +1 -1
  52. data/fastlane/swift/Scanfile.swift +1 -1
  53. data/fastlane/swift/ScanfileProtocol.swift +17 -1
  54. data/fastlane/swift/Screengrabfile.swift +1 -1
  55. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -9
  56. data/fastlane/swift/Snapshotfile.swift +1 -1
  57. data/fastlane/swift/SnapshotfileProtocol.swift +9 -1
  58. data/fastlane_core/lib/fastlane_core/build_watcher.rb +6 -2
  59. data/fastlane_core/lib/fastlane_core/cert_checker.rb +28 -0
  60. data/fastlane_core/lib/fastlane_core/device_manager.rb +20 -0
  61. data/fastlane_core/lib/fastlane_core/helper.rb +7 -1
  62. data/fastlane_core/lib/fastlane_core/project.rb +23 -0
  63. data/frameit/lib/frameit/editor.rb +3 -0
  64. data/gym/lib/gym/code_signing_mapping.rb +32 -3
  65. data/gym/lib/gym/detect_values.rb +34 -2
  66. data/gym/lib/gym/generators/build_command_generator.rb +1 -0
  67. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  68. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +47 -17
  69. data/gym/lib/gym/module.rb +8 -0
  70. data/gym/lib/gym/options.rb +25 -1
  71. data/gym/lib/gym/runner.rb +63 -23
  72. data/match/lib/match/encryption/openssl.rb +1 -1
  73. data/match/lib/match/generator.rb +17 -3
  74. data/match/lib/match/module.rb +4 -1
  75. data/match/lib/match/nuke.rb +54 -16
  76. data/match/lib/match/options.rb +28 -15
  77. data/match/lib/match/runner.rb +21 -8
  78. data/match/lib/match/spaceship_ensure.rb +19 -9
  79. data/match/lib/match/storage/git_storage.rb +11 -3
  80. data/pilot/lib/pilot/build_manager.rb +46 -12
  81. data/pilot/lib/pilot/options.rb +3 -1
  82. data/scan/lib/scan/detect_values.rb +6 -1
  83. data/scan/lib/scan/manager.rb +18 -1
  84. data/scan/lib/scan/options.rb +23 -1
  85. data/scan/lib/scan/runner.rb +6 -0
  86. data/scan/lib/scan/slack_poster.rb +1 -1
  87. data/scan/lib/scan/test_command_generator.rb +1 -1
  88. data/screengrab/lib/screengrab/options.rb +1 -10
  89. data/screengrab/lib/screengrab/runner.rb +16 -19
  90. data/snapshot/lib/snapshot/options.rb +12 -1
  91. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  92. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +11 -0
  93. data/spaceship/lib/spaceship/client.rb +9 -4
  94. data/spaceship/lib/spaceship/connect_api.rb +2 -0
  95. data/spaceship/lib/spaceship/connect_api/models/app.rb +11 -0
  96. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +75 -0
  97. data/spaceship/lib/spaceship/connect_api/models/beta_screenshot.rb +18 -0
  98. data/spaceship/lib/spaceship/connect_api/models/build.rb +5 -0
  99. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +5 -0
  100. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +15 -0
  101. data/spaceship/lib/spaceship/portal/app.rb +11 -2
  102. data/spaceship/lib/spaceship/tunes/iap.rb +11 -11
  103. data/spaceship/lib/spaceship/tunes/iap_detail.rb +7 -3
  104. data/spaceship/lib/spaceship/tunes/iap_families.rb +12 -1
  105. data/spaceship/lib/spaceship/tunes/iap_family_details.rb +26 -17
  106. data/spaceship/lib/spaceship/tunes/iap_status.rb +5 -1
  107. data/spaceship/lib/spaceship/tunes/tunes_client.rb +4 -7
  108. data/supply/lib/supply/client.rb +27 -0
  109. data/supply/lib/supply/options.rb +8 -2
  110. data/supply/lib/supply/uploader.rb +55 -26
  111. metadata +44 -25
  112. data/supply/lib/supply/.uploader.rb.swp +0 -0
@@ -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
@@ -317,6 +317,21 @@ module Spaceship
317
317
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
318
318
  Client.instance.get("preReleaseVersions", params)
319
319
  end
320
+
321
+ #
322
+ # betaFeedbacks (private API as of end 2019)
323
+ #
324
+
325
+ def get_beta_feedback(filter: {}, includes: nil, limit: nil, sort: nil)
326
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
327
+ Client.instance.get("betaFeedbacks", params)
328
+ end
329
+
330
+ def delete_beta_feedback(feedback_id: nil)
331
+ raise "Feedback id is nil" if feedback_id.nil?
332
+
333
+ Client.instance.delete("betaFeedbacks/#{feedback_id}")
334
+ end
320
335
  end
321
336
  end
322
337
  end
@@ -108,9 +108,18 @@ module Spaceship
108
108
  # @return (App) The app you're looking for. This is nil if the app can't be found.
109
109
  def find(bundle_id, mac: false)
110
110
  raise "`bundle_id` parameter must not be nil" if bundle_id.nil?
111
- all(mac: mac).find do |app|
112
- return app if app.bundle_id.casecmp(bundle_id) == 0
111
+ found_app = all(mac: mac).find do |app|
112
+ app if app.bundle_id.casecmp(bundle_id) == 0
113
113
  end
114
+
115
+ # Find catalyst enabled mac apps (look for mac first and then iOS)
116
+ if !found_app && mac
117
+ found_app = all(mac: false).find do |app|
118
+ app if app.bundle_id.casecmp(bundle_id) == 0
119
+ end
120
+ end
121
+
122
+ found_app
114
123
  end
115
124
  end
116
125
 
@@ -105,17 +105,6 @@ module Spaceship
105
105
  end
106
106
  end
107
107
 
108
- # find a specific product
109
- # @param product_id (String) Product Id
110
- def find(product_id)
111
- all.each do |product|
112
- if product.product_id == product_id
113
- return product
114
- end
115
- end
116
- return nil
117
- end
118
-
119
108
  # return all available In-App-Purchase's of current app
120
109
  # this is not paged inside iTC-API so if you have a lot if IAP's (2k+)
121
110
  # it might take some time to load, same as it takes when you load the list via App Store Connect
@@ -132,6 +121,17 @@ module Spaceship
132
121
  return_iaps
133
122
  end
134
123
 
124
+ # find a specific product
125
+ # @param product_id (String) Product Id
126
+ def find(product_id)
127
+ all.each do |product|
128
+ if product.product_id == product_id
129
+ return product
130
+ end
131
+ end
132
+ return nil
133
+ end
134
+
135
135
  private
136
136
 
137
137
  def find_product_with_retries(product_id, max_tries)
@@ -80,7 +80,9 @@ module Spaceship
80
80
  language = localized_version["value"]["localeCode"]
81
81
  parsed_versions[language.to_sym] = {
82
82
  name: localized_version["value"]["name"]["value"],
83
- description: localized_version["value"]["description"]["value"]
83
+ description: localized_version["value"]["description"]["value"],
84
+ id: localized_version["value"]["id"],
85
+ status: localized_version["value"]["status"]
84
86
  }
85
87
  end
86
88
  return parsed_versions
@@ -98,7 +100,8 @@ module Spaceship
98
100
  "value" => {
99
101
  "name" => { "value" => current_version[:name] },
100
102
  "description" => { "value" => current_version[:description] },
101
- "localeCode" => language.to_s
103
+ "localeCode" => language.to_s,
104
+ "id" => current_version[:id]
102
105
  }
103
106
  }
104
107
  end
@@ -167,7 +170,8 @@ module Spaceship
167
170
  "value" => {
168
171
  "description" => { "value" => value[:description] },
169
172
  "name" => { "value" => value[:name] },
170
- "localeCode" => language.to_s
173
+ "localeCode" => language.to_s,
174
+ "id" => value[:id]
171
175
  }
172
176
  }
173
177
  end
@@ -40,7 +40,7 @@ module Spaceship
40
40
  client.create_iap_family(app_id: self.application.apple_id, name: name, product_id: product_id, reference_name: reference_name, versions: versions_array)
41
41
  end
42
42
 
43
- # returns a list of all families
43
+ # returns a list of all available subscription groups/families of the current In-App-Purchase
44
44
  def all
45
45
  r = client.iap_families(app_id: self.application.apple_id)
46
46
  return_families = []
@@ -52,6 +52,17 @@ module Spaceship
52
52
  end
53
53
  return_families
54
54
  end
55
+
56
+ # find a specific family
57
+ # @param family_id (String) Family Id
58
+ def find(family_id)
59
+ all.each do |family|
60
+ if family.family_id == family_id
61
+ return family
62
+ end
63
+ end
64
+ return nil
65
+ end
55
66
  end
56
67
  end
57
68
  end
@@ -18,13 +18,34 @@ module Spaceship
18
18
  # @return (Intger) amount of linked in-app purchases of this family (read-only)
19
19
  attr_accessor :iap_count
20
20
 
21
+ # @return (Array) of all in-app purchase family details
22
+ attr_accessor :family_details
23
+
21
24
  attr_mapping({
22
25
  'id' => :family_id,
23
26
  'name.value' => :name,
24
27
  'activeAddOns' => :linked_iaps,
25
- 'totalActiveAddOns' => :iap_count
28
+ 'totalActiveAddOns' => :iap_count,
29
+ 'details.value' => :family_details
26
30
  })
27
31
 
32
+ # @return (Hash) localized names
33
+ def versions
34
+ parsed_versions = {}
35
+ raw_versions = raw_data["details"]["value"]
36
+ raw_versions.each do |version|
37
+ language = version["value"]["localeCode"]["value"]
38
+ parsed_versions[language.to_sym] = {
39
+ subscription_name: version["value"]["subscriptionName"]["value"],
40
+ name: version["value"]["name"]["value"],
41
+ id: version["value"]["id"],
42
+ status: version["value"]["status"]
43
+ }
44
+ end
45
+ return parsed_versions
46
+ end
47
+
48
+ # transforms user-set versions to iTC ones
28
49
  def versions=(value = {})
29
50
  if value.kind_of?(Array)
30
51
  # input that comes from iTC api
@@ -36,7 +57,8 @@ module Spaceship
36
57
  "value" => {
37
58
  "subscriptionName" => { "value" => current_version[:subscription_name] },
38
59
  "name" => { "value" => current_version[:name] },
39
- "localeCode" => { "value" => language }
60
+ "localeCode" => { "value" => language },
61
+ "id" => current_version[:id]
40
62
  }
41
63
  }
42
64
  end
@@ -44,20 +66,6 @@ module Spaceship
44
66
  raw_data.set(["details"], { "value" => new_versions })
45
67
  end
46
68
 
47
- # @return (Hash) localized names
48
- def versions
49
- parsed_versions = {}
50
- raw_versions = raw_data["details"]["value"]
51
- raw_versions.each do |version|
52
- language = version["value"]["localeCode"]["value"]
53
- parsed_versions[language.to_sym] = {
54
- subscription_name: version["value"]["subscriptionName"]["value"],
55
- name: version["value"]["name"]["value"]
56
- }
57
- end
58
- return parsed_versions
59
- end
60
-
61
69
  # modify existing family
62
70
  def save!
63
71
  # Transform localization versions back to original format.
@@ -67,7 +75,8 @@ module Spaceship
67
75
  "value" => {
68
76
  "subscriptionName" => { "value" => value[:subscription_name] },
69
77
  "name" => { "value" => value[:name] },
70
- "localeCode" => { "value" => language_code.to_s }
78
+ "localeCode" => { "value" => language_code.to_s },
79
+ "id" => value[:id]
71
80
  }
72
81
  }
73
82
  end
@@ -28,6 +28,9 @@ module Spaceship
28
28
  # The developer took the app from the App Store
29
29
  DEVELOPER_REMOVED_FROM_SALE = "Developer Removed From Sale"
30
30
 
31
+ # In-app purchase need developer's action
32
+ DEVELOPER_ACTION_NEEDED = "Developer Action Needed"
33
+
31
34
  # Get the iap status matching based on a string (given by App Store Connect)
32
35
  def self.get_from_string(text)
33
36
  mapping = {
@@ -38,7 +41,8 @@ module Spaceship
38
41
  'readyForSale' => APPROVED,
39
42
  'deleted' => DELETED,
40
43
  'rejected' => REJECTED,
41
- 'developerRemovedFromSale' => DEVELOPER_REMOVED_FROM_SALE
44
+ 'developerRemovedFromSale' => DEVELOPER_REMOVED_FROM_SALE,
45
+ 'developerActionNeeded' => DEVELOPER_ACTION_NEEDED
42
46
  }
43
47
 
44
48
  mapping.each do |itc_status, readable_status|
@@ -400,7 +400,7 @@ module Spaceship
400
400
  rating_url << "sort=REVIEW_SORT_ORDER_MOST_RECENT"
401
401
  rating_url << "&index=#{index}"
402
402
  rating_url << "&storefront=#{storefront}" unless storefront.empty?
403
- rating_url << "&version_id=#{version_id}" unless version_id.empty?
403
+ rating_url << "&versionId=#{version_id}" unless version_id.empty?
404
404
 
405
405
  r = request(:get, rating_url)
406
406
  all_reviews.concat(parse_response(r, 'data')['reviews'])
@@ -627,7 +627,7 @@ module Spaceship
627
627
  handle_itc_response(r.body)
628
628
  end
629
629
 
630
- def transform_to_raw_pricing_intervals(app_id = nil, purchase_id = nil, pricing_intervals = nil, subscription_price_target = nil)
630
+ def transform_to_raw_pricing_intervals(app_id = nil, purchase_id = nil, pricing_intervals = 5, subscription_price_target = nil)
631
631
  intervals_array = []
632
632
  if pricing_intervals
633
633
  intervals_array = pricing_intervals.map do |interval|
@@ -784,11 +784,8 @@ module Spaceship
784
784
  end
785
785
 
786
786
  def available_languages
787
- r = request(:get, "ra/apps/storePreview/regionCountryLanguage")
788
- response = parse_response(r, 'data')
789
- response.flat_map { |region| region["storeFronts"] }
790
- .flat_map { |storefront| storefront["supportedLocaleCodes"] }
791
- .uniq
787
+ r = request(:get, "ra/ref")
788
+ parse_response(r, 'data')['detailLocales']
792
789
  end
793
790
 
794
791
  #####################################################
@@ -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,11 +353,25 @@ 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!
346
372
 
347
373
  all_tracks = call_google_api { client.list_edit_tracks(current_package_name, current_edit.id) }.tracks
374
+ all_tracks = [] unless all_tracks
348
375
 
349
376
  if tracknames.length > 0
350
377
  all_tracks = all_tracks.select { |track| tracknames.include?(track.track) }
@@ -43,7 +43,10 @@ module Supply
43
43
  env_name: "SUPPLY_TRACK",
44
44
  description: "The track of the application to use. The default available tracks are: #{Supply::Tracks::DEFAULTS.join(', ')}",
45
45
  default_value: Supply::Tracks::DEFAULT,
46
- type: String),
46
+ type: String,
47
+ verify_block: proc do |value|
48
+ UI.user_error!("'rollout' is no longer a valid track name - please use 'production' instead") if value.casecmp('rollout').zero?
49
+ end),
47
50
  FastlaneCore::ConfigItem.new(key: :rollout,
48
51
  short_option: "-r",
49
52
  description: "The percentage of the user fraction when uploading to the rollout track",
@@ -208,7 +211,10 @@ module Supply
208
211
  FastlaneCore::ConfigItem.new(key: :track_promote_to,
209
212
  env_name: "SUPPLY_TRACK_PROMOTE_TO",
210
213
  optional: true,
211
- description: "The track to promote to. The default available tracks are: #{Supply::Tracks::DEFAULTS.join(', ')}"),
214
+ description: "The track to promote to. The default available tracks are: #{Supply::Tracks::DEFAULTS.join(', ')}",
215
+ verify_block: proc do |value|
216
+ UI.user_error!("'rollout' is no longer a valid track name - please use 'production' instead") if value.casecmp('rollout').zero?
217
+ end),
212
218
  FastlaneCore::ConfigItem.new(key: :validate_only,
213
219
  env_name: "SUPPLY_VALIDATE_ONLY",
214
220
  optional: true,
@@ -15,32 +15,62 @@ module Supply
15
15
 
16
16
  apk_version_codes.concat(Supply.config[:version_codes_to_retain]) if Supply.config[:version_codes_to_retain]
17
17
 
18
- # Only update tracks if we have version codes
19
- # Updating a track with empty version codes can completely clear out a track
20
- update_track(apk_version_codes) unless apk_version_codes.empty?
21
-
22
- if Supply.config[:track_promote_to]
23
- promote_track
24
- elsif !Supply.config[:rollout].nil? && Supply.config[:track].to_s != ""
25
- update_rollout
18
+ if !apk_version_codes.empty?
19
+ # Only update tracks if we have version codes
20
+ # update_track handle setting rollout if needed
21
+ # Updating a track with empty version codes can completely clear out a track
22
+ update_track(apk_version_codes)
23
+ else
24
+ # Only promote or rollout if we don't have version codes
25
+ if Supply.config[:track_promote_to]
26
+ promote_track
27
+ elsif !Supply.config[:rollout].nil? && Supply.config[:track].to_s != ""
28
+ update_rollout
29
+ end
26
30
  end
27
31
 
32
+ perform_upload_meta(apk_version_codes)
33
+
28
34
  if Supply.config[:validate_only]
29
- UI.message("Validating all track and release changes with Google Play...")
35
+ UI.message("Validating all changes with Google Play...")
30
36
  client.validate_current_edit!
31
37
  UI.success("Successfully validated the upload to Google Play")
32
38
  else
33
- UI.message("Uploading all track and release changes to Google Play...")
39
+ UI.message("Uploading all changes to Google Play...")
34
40
  client.commit_current_edit!
35
41
  UI.success("Successfully finished the upload to Google Play")
36
42
  end
43
+ end
37
44
 
38
- perform_upload_meta(apk_version_codes)
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
39
71
  end
40
72
 
41
73
  def perform_upload_meta(version_codes)
42
- client.begin_edit(package_name: Supply.config[:package_name])
43
-
44
74
  if (!Supply.config[:skip_upload_metadata] || !Supply.config[:skip_upload_images] || !Supply.config[:skip_upload_changelogs] || !Supply.config[:skip_upload_screenshots]) && metadata_path
45
75
  # Use version code from config if version codes is empty and no nil or empty string
46
76
  version_codes = [Supply.config[:version_code]] if version_codes.empty?
@@ -71,16 +101,6 @@ module Supply
71
101
  upload_changelogs(release_notes, release, track) unless release_notes.empty?
72
102
  end
73
103
  end
74
-
75
- if Supply.config[:validate_only]
76
- UI.message("Validating all meta changes with Google Play...")
77
- client.validate_current_edit!
78
- UI.success("Successfully validated the upload to Google Play")
79
- else
80
- UI.message("Uploading all meta changes to Google Play...")
81
- client.commit_current_edit!
82
- UI.success("Successfully finished the upload to Google Play")
83
- end
84
104
  end
85
105
 
86
106
  def fetch_track_and_release!(track, version_code, status = nil)
@@ -203,7 +223,13 @@ module Supply
203
223
  UI.message("Updating changelog for '#{version_code}' and language '#{language}'...")
204
224
  changelog_text = File.read(path, encoding: 'UTF-8')
205
225
  else
206
- UI.message("Could not find changelog for '#{version_code}' and language '#{language}' at path #{path}...")
226
+ default_changelog_path = File.join(Supply.config[:metadata_path], language, Supply::CHANGELOGS_FOLDER_NAME, "default.txt")
227
+ if File.exist?(default_changelog_path)
228
+ UI.message("Updating changelog for '#{version_code}' and language '#{language}' to default changelog...")
229
+ changelog_text = File.read(default_changelog_path, encoding: 'UTF-8')
230
+ else
231
+ UI.message("Could not find changelog for '#{version_code}' and language '#{language}' at path #{path}...")
232
+ end
207
233
  end
208
234
 
209
235
  AndroidPublisher::LocalizedText.new({
@@ -358,8 +384,11 @@ module Supply
358
384
  )
359
385
 
360
386
  if Supply.config[:rollout]
361
- track_release.status = Supply::ReleaseStatus::IN_PROGRESS
362
- track_release.user_fraction = Supply.config[:rollout].to_f
387
+ rollout = Supply.config[:rollout].to_f
388
+ if rollout > 0 && rollout < 1
389
+ track_release.status = Supply::ReleaseStatus::IN_PROGRESS
390
+ track_release.user_fraction = rollout
391
+ end
363
392
  end
364
393
 
365
394
  tracks = client.tracks(Supply.config[:track])