fastlane 2.162.0 → 2.167.0

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +78 -78
  3. data/cert/lib/cert/runner.rb +2 -2
  4. data/deliver/lib/deliver/app_screenshot.rb +6 -2
  5. data/deliver/lib/deliver/module.rb +2 -0
  6. data/deliver/lib/deliver/options.rb +3 -3
  7. data/deliver/lib/deliver/queue_worker.rb +14 -29
  8. data/deliver/lib/deliver/upload_metadata.rb +19 -5
  9. data/deliver/lib/deliver/upload_screenshots.rb +3 -5
  10. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  11. data/fastlane/lib/fastlane/actions/actions_helper.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/add_git_tag.rb +9 -2
  13. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +39 -3
  14. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +9 -0
  15. data/fastlane/lib/fastlane/actions/appledoc.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +1 -0
  17. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +5 -1
  18. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +9 -0
  19. data/fastlane/lib/fastlane/actions/get_certificates.rb +1 -0
  20. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +1 -0
  21. data/fastlane/lib/fastlane/actions/import_from_git.rb +9 -1
  22. data/fastlane/lib/fastlane/actions/is_ci.rb +1 -1
  23. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +15 -0
  24. data/fastlane/lib/fastlane/actions/register_device.rb +46 -5
  25. data/fastlane/lib/fastlane/actions/register_devices.rb +50 -16
  26. data/fastlane/lib/fastlane/actions/set_changelog.rb +31 -3
  27. data/fastlane/lib/fastlane/actions/spm.rb +6 -0
  28. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -0
  29. data/fastlane/lib/fastlane/actions/update_fastlane.rb +29 -8
  30. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -2
  31. data/fastlane/lib/fastlane/cli_tools_distributor.rb +2 -2
  32. data/fastlane/lib/fastlane/fast_file.rb +74 -23
  33. data/fastlane/lib/fastlane/features.rb +1 -1
  34. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -0
  35. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  36. data/fastlane/lib/fastlane/version.rb +1 -1
  37. data/fastlane/swift/Deliverfile.swift +1 -1
  38. data/fastlane/swift/DeliverfileProtocol.swift +4 -4
  39. data/fastlane/swift/Fastfile.swift +1 -1
  40. data/fastlane/swift/Fastlane.swift +73 -22
  41. data/fastlane/swift/Gymfile.swift +1 -1
  42. data/fastlane/swift/GymfileProtocol.swift +1 -1
  43. data/fastlane/swift/LaneFileProtocol.swift +15 -19
  44. data/fastlane/swift/MainProcess.swift +3 -1
  45. data/fastlane/swift/Matchfile.swift +1 -1
  46. data/fastlane/swift/MatchfileProtocol.swift +6 -2
  47. data/fastlane/swift/Precheckfile.swift +1 -1
  48. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  49. data/fastlane/swift/Runner.swift +1 -1
  50. data/fastlane/swift/Scanfile.swift +1 -1
  51. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  52. data/fastlane/swift/Screengrabfile.swift +1 -1
  53. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  54. data/fastlane/swift/Snapshotfile.swift +1 -1
  55. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  56. data/fastlane/swift/SocketClient.swift +1 -1
  57. data/fastlane/swift/main.swift +1 -1
  58. data/fastlane_core/lib/fastlane_core/cert_checker.rb +12 -7
  59. data/fastlane_core/lib/fastlane_core/device_manager.rb +8 -4
  60. data/fastlane_core/lib/fastlane_core/helper.rb +10 -2
  61. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -3
  62. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -1
  63. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +3 -1
  64. data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +8 -0
  65. data/gym/lib/gym/code_signing_mapping.rb +1 -1
  66. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  67. data/match/lib/match/importer.rb +33 -21
  68. data/match/lib/match/nuke.rb +9 -5
  69. data/match/lib/match/options.rb +7 -1
  70. data/pilot/lib/pilot/build_manager.rb +9 -3
  71. data/scan/lib/scan/detect_values.rb +8 -9
  72. data/scan/lib/scan/module.rb +4 -0
  73. data/scan/lib/scan/options.rb +9 -0
  74. data/scan/lib/scan/runner.rb +2 -1
  75. data/sigh/lib/assets/resign.sh +1 -1
  76. data/sigh/lib/sigh/download_all.rb +16 -4
  77. data/sigh/lib/sigh/runner.rb +4 -4
  78. data/snapshot/lib/assets/SnapshotHelper.swift +4 -0
  79. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +2 -1
  80. data/snapshot/lib/snapshot/test_command_generator.rb +1 -1
  81. data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
  82. data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +1 -1
  83. data/spaceship/lib/spaceship/client.rb +7 -3
  84. data/spaceship/lib/spaceship/connect_api.rb +26 -0
  85. data/spaceship/lib/spaceship/connect_api/api_client.rb +9 -0
  86. data/spaceship/lib/spaceship/connect_api/client.rb +7 -4
  87. data/spaceship/lib/spaceship/connect_api/models/app.rb +51 -0
  88. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +9 -0
  89. data/spaceship/lib/spaceship/connect_api/models/custom_app_organization.rb +43 -0
  90. data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
  91. data/spaceship/lib/spaceship/connect_api/models/device.rb +5 -0
  92. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +17 -0
  93. data/spaceship/lib/spaceship/connect_api/spaceship.rb +7 -4
  94. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  95. data/spaceship/lib/spaceship/connect_api/token.rb +6 -1
  96. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +71 -0
  97. data/supply/lib/supply.rb +1 -1
  98. data/supply/lib/supply/uploader.rb +1 -1
  99. metadata +21 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfbc3b8babe2db6398b23a113db895f79eea46daa635909a2146e2df6ab4fa2d
4
- data.tar.gz: d643dd677d37e514523433380eb65dc67798ec67cb9c4726c33e84529156b337
3
+ metadata.gz: 12fc2f2fba2826c89ba9d96fb23aaf99ff241513f980e97cc6bd911683b563d1
4
+ data.tar.gz: 189a71d8c59ce592ec3ef3c94c6cd4605ae3e6e130fb8dfd57a286aeffbffad4
5
5
  SHA512:
6
- metadata.gz: c50b7bb1afb78e3c2e8577d11092879dfb0c748a131ba3cf164a05e1f41df81d1472a951f1b609eaced0162c85045221ff08813ae69d0ae713ef325e2aa11a46
7
- data.tar.gz: 873270ee657aa2d0fe1f13153d2bf2c26e1ed5fbebb6815ca363f783f3550bbb30abad62922b115402a38231681af72211feaac937611e1773448a493f54003c
6
+ metadata.gz: 2ce1affc526767654afe6c01483ae298d0a99b09f433fdae244956ff01d46947fb785e3d934bfa052c16c3b1064659ff368eda6746181162964ffd139a46ff61
7
+ data.tar.gz: 7b33693ca6d648c49065a72152357491945a43f2936b245dde1eda2d91855eb319d23a4080315f9eb1c70bf2f90d6e4df845611acfd8674b9853a83e0dcded15
data/README.md CHANGED
@@ -34,61 +34,49 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
34
34
  <!-- This table is regenerated and resorted on each release -->
35
35
  <table id='team'>
36
36
  <tr>
37
- <td id='matthew-ellis'>
38
- <a href='https://github.com/matthewellis'>
39
- <img src='https://github.com/matthewellis.png?size=140'>
37
+ <td id='aaron-brager'>
38
+ <a href='https://github.com/getaaron'>
39
+ <img src='https://github.com/getaaron.png?size=140'>
40
40
  </a>
41
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
41
+ <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
42
42
  </td>
43
- <td id='andrew-mcburney'>
44
- <a href='https://github.com/armcburney'>
45
- <img src='https://github.com/armcburney.png?size=140'>
43
+ <td id='jimmy-dee'>
44
+ <a href='https://github.com/jdee'>
45
+ <img src='https://github.com/jdee.png?size=140'>
46
46
  </a>
47
- <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
47
+ <h4 align='center'>Jimmy Dee</h4>
48
48
  </td>
49
- <td id='fumiya-nakamura'>
50
- <a href='https://github.com/nafu'>
51
- <img src='https://github.com/nafu.png?size=140'>
49
+ <td id='max-ott'>
50
+ <a href='https://github.com/max-ott'>
51
+ <img src='https://github.com/max-ott.png?size=140'>
52
52
  </a>
53
- <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
53
+ <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
54
54
  </td>
55
- <td id='stefan-natchev'>
56
- <a href='https://github.com/snatchev'>
57
- <img src='https://github.com/snatchev.png?size=140'>
55
+ <td id='jorge-revuelta-h'>
56
+ <a href='https://github.com/minuscorp'>
57
+ <img src='https://github.com/minuscorp.png?size=140'>
58
58
  </a>
59
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
59
+ <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
60
60
  </td>
61
- <td id='felix-krause'>
62
- <a href='https://github.com/KrauseFx'>
63
- <img src='https://github.com/KrauseFx.png?size=140'>
61
+ <td id='manu-wallner'>
62
+ <a href='https://github.com/milch'>
63
+ <img src='https://github.com/milch.png?size=140'>
64
64
  </a>
65
- <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
65
+ <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
66
66
  </td>
67
67
  </tr>
68
68
  <tr>
69
- <td id='iulian-onofrei'>
70
- <a href='https://github.com/revolter'>
71
- <img src='https://github.com/revolter.png?size=140'>
72
- </a>
73
- <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
74
- </td>
75
- <td id='jimmy-dee'>
76
- <a href='https://github.com/jdee'>
77
- <img src='https://github.com/jdee.png?size=140'>
78
- </a>
79
- <h4 align='center'>Jimmy Dee</h4>
80
- </td>
81
69
  <td id='jan-piotrowski'>
82
70
  <a href='https://github.com/janpio'>
83
71
  <img src='https://github.com/janpio.png?size=140'>
84
72
  </a>
85
73
  <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
86
74
  </td>
87
- <td id='jorge-revuelta-h'>
88
- <a href='https://github.com/minuscorp'>
89
- <img src='https://github.com/minuscorp.png?size=140'>
75
+ <td id='olivier-halligon'>
76
+ <a href='https://github.com/AliSoftware'>
77
+ <img src='https://github.com/AliSoftware.png?size=140'>
90
78
  </a>
91
- <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
79
+ <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
92
80
  </td>
93
81
  <td id='jérôme-lacoste'>
94
82
  <a href='https://github.com/lacostej'>
@@ -96,37 +84,49 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
96
84
  </a>
97
85
  <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
98
86
  </td>
99
- </tr>
100
- <tr>
101
- <td id='daniel-jankowski'>
102
- <a href='https://github.com/mollyIV'>
103
- <img src='https://github.com/mollyIV.png?size=140'>
87
+ <td id='luka-mirosevic'>
88
+ <a href='https://github.com/lmirosevic'>
89
+ <img src='https://github.com/lmirosevic.png?size=140'>
104
90
  </a>
105
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
91
+ <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
106
92
  </td>
93
+ <td id='stefan-natchev'>
94
+ <a href='https://github.com/snatchev'>
95
+ <img src='https://github.com/snatchev.png?size=140'>
96
+ </a>
97
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
98
+ </td>
99
+ </tr>
100
+ <tr>
107
101
  <td id='joshua-liebowitz'>
108
102
  <a href='https://github.com/taquitos'>
109
103
  <img src='https://github.com/taquitos.png?size=140'>
110
104
  </a>
111
105
  <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
112
106
  </td>
113
- <td id='danielle-tomlinson'>
114
- <a href='https://github.com/endocrimes'>
115
- <img src='https://github.com/endocrimes.png?size=140'>
107
+ <td id='andrew-mcburney'>
108
+ <a href='https://github.com/armcburney'>
109
+ <img src='https://github.com/armcburney.png?size=140'>
116
110
  </a>
117
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
111
+ <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
118
112
  </td>
119
- <td id='max-ott'>
120
- <a href='https://github.com/max-ott'>
121
- <img src='https://github.com/max-ott.png?size=140'>
113
+ <td id='matthew-ellis'>
114
+ <a href='https://github.com/matthewellis'>
115
+ <img src='https://github.com/matthewellis.png?size=140'>
122
116
  </a>
123
- <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
117
+ <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
124
118
  </td>
125
- <td id='luka-mirosevic'>
126
- <a href='https://github.com/lmirosevic'>
127
- <img src='https://github.com/lmirosevic.png?size=140'>
119
+ <td id='kohki-miki'>
120
+ <a href='https://github.com/giginet'>
121
+ <img src='https://github.com/giginet.png?size=140'>
128
122
  </a>
129
- <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
123
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
124
+ </td>
125
+ <td id='daniel-jankowski'>
126
+ <a href='https://github.com/mollyIV'>
127
+ <img src='https://github.com/mollyIV.png?size=140'>
128
+ </a>
129
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
130
130
  </td>
131
131
  </tr>
132
132
  <tr>
@@ -136,43 +136,43 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
136
136
  </a>
137
137
  <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
138
138
  </td>
139
- <td id='olivier-halligon'>
140
- <a href='https://github.com/AliSoftware'>
141
- <img src='https://github.com/AliSoftware.png?size=140'>
139
+ <td id='maksym-grebenets'>
140
+ <a href='https://github.com/mgrebenets'>
141
+ <img src='https://github.com/mgrebenets.png?size=140'>
142
142
  </a>
143
- <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
143
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
144
144
  </td>
145
- <td id='josh-holtz'>
146
- <a href='https://github.com/joshdholtz'>
147
- <img src='https://github.com/joshdholtz.png?size=140'>
145
+ <td id='felix-krause'>
146
+ <a href='https://github.com/KrauseFx'>
147
+ <img src='https://github.com/KrauseFx.png?size=140'>
148
148
  </a>
149
- <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
149
+ <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
150
150
  </td>
151
- <td id='aaron-brager'>
152
- <a href='https://github.com/getaaron'>
153
- <img src='https://github.com/getaaron.png?size=140'>
151
+ <td id='iulian-onofrei'>
152
+ <a href='https://github.com/revolter'>
153
+ <img src='https://github.com/revolter.png?size=140'>
154
154
  </a>
155
- <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
155
+ <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
156
156
  </td>
157
- <td id='kohki-miki'>
158
- <a href='https://github.com/giginet'>
159
- <img src='https://github.com/giginet.png?size=140'>
157
+ <td id='josh-holtz'>
158
+ <a href='https://github.com/joshdholtz'>
159
+ <img src='https://github.com/joshdholtz.png?size=140'>
160
160
  </a>
161
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
161
+ <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
162
162
  </td>
163
163
  </tr>
164
164
  <tr>
165
- <td id='manu-wallner'>
166
- <a href='https://github.com/milch'>
167
- <img src='https://github.com/milch.png?size=140'>
165
+ <td id='danielle-tomlinson'>
166
+ <a href='https://github.com/endocrimes'>
167
+ <img src='https://github.com/endocrimes.png?size=140'>
168
168
  </a>
169
- <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
169
+ <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
170
170
  </td>
171
- <td id='maksym-grebenets'>
172
- <a href='https://github.com/mgrebenets'>
173
- <img src='https://github.com/mgrebenets.png?size=140'>
171
+ <td id='fumiya-nakamura'>
172
+ <a href='https://github.com/nafu'>
173
+ <img src='https://github.com/nafu.png?size=140'>
174
174
  </a>
175
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
176
176
  </td>
177
177
  </table>
178
178
 
@@ -190,7 +190,7 @@ module Cert
190
190
  begin
191
191
  certificate = Spaceship::ConnectAPI::Certificate.create(
192
192
  certificate_type: certificate_type,
193
- csr_content: csr
193
+ csr_content: csr.to_pem
194
194
  )
195
195
  rescue => ex
196
196
  type_name = (Cert.config[:development] ? "Development" : "Distribution")
@@ -232,7 +232,7 @@ module Cert
232
232
  cert_name = "#{cert_name}.cer" unless File.extname(cert_name) == ".cer"
233
233
  path = File.expand_path(File.join(Cert.config[:output_path], cert_name))
234
234
  raw_data = Base64.decode64(certificate.certificate_content)
235
- File.write(path, raw_data)
235
+ File.write(path, raw_data.force_encoding("UTF-8"))
236
236
  return path
237
237
  end
238
238
  end
@@ -187,7 +187,9 @@ module Deliver
187
187
  return {
188
188
  ScreenSize::IOS_65_MESSAGES => [
189
189
  [1242, 2688],
190
- [2688, 1242]
190
+ [2688, 1242],
191
+ [1284, 2778],
192
+ [2778, 1284]
191
193
  ],
192
194
  ScreenSize::IOS_61_MESSAGES => [
193
195
  [828, 1792],
@@ -243,7 +245,9 @@ module Deliver
243
245
  return {
244
246
  ScreenSize::IOS_65 => [
245
247
  [1242, 2688],
246
- [2688, 1242]
248
+ [2688, 1242],
249
+ [1284, 2778],
250
+ [2778, 1284]
247
251
  ],
248
252
  ScreenSize::IOS_61 => [
249
253
  [828, 1792],
@@ -1,5 +1,6 @@
1
1
  require 'fastlane_core/helper'
2
2
  require 'fastlane_core/ui/ui'
3
+ require 'fastlane/boolean'
3
4
 
4
5
  module Deliver
5
6
  class << self
@@ -7,6 +8,7 @@ module Deliver
7
8
 
8
9
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
9
10
  UI = FastlaneCore::UI
11
+ Boolean = Fastlane::Boolean
10
12
 
11
13
  # Constant that captures the root Pathname for the project. Should be used for building paths to assets or other
12
14
  # resources that code needs to locate locally
@@ -153,7 +153,7 @@ module Deliver
153
153
  FastlaneCore::ConfigItem.new(key: :force,
154
154
  short_option: "-f",
155
155
  env_name: "DELIVER_FORCE",
156
- description: "Skip the HTML report file verification",
156
+ description: "Skip verification of HTML preview file",
157
157
  is_string: false,
158
158
  default_value: false),
159
159
  FastlaneCore::ConfigItem.new(key: :overwrite_screenshots,
@@ -176,8 +176,8 @@ module Deliver
176
176
  FastlaneCore::ConfigItem.new(key: :automatic_release,
177
177
  env_name: "DELIVER_AUTOMATIC_RELEASE",
178
178
  description: "Should the app be automatically released once it's approved? (Can not be used together with `auto_release_date`)",
179
- is_string: false,
180
- default_value: false),
179
+ type: Boolean,
180
+ optional: true),
181
181
  FastlaneCore::ConfigItem.new(key: :auto_release_date,
182
182
  env_name: "DELIVER_AUTO_RELEASE_DATE",
183
183
  description: "Date in milliseconds for automatically releasing on pending approval (Can not be used together with `automatic_release`)",
@@ -6,9 +6,11 @@ module Deliver
6
6
  # Use this when you have all the items that you'll process in advance.
7
7
  # Simply enqueue them to this and call `QueueWorker#start`.
8
8
  class QueueWorker
9
+ NUMBER_OF_THREADS = Helper.test? ? 1 : [ENV.fetch("DELIVER_NUMBER_OF_THREADS", 10).to_i, 10].min
10
+
9
11
  # @param concurrency (Numeric) - A number of threads to be created
10
12
  # @param block (Proc) - A task you want to execute with enqueued items
11
- def initialize(concurrency, &block)
13
+ def initialize(concurrency = NUMBER_OF_THREADS, &block)
12
14
  @concurrency = concurrency
13
15
  @block = block
14
16
  @queue = Queue.new
@@ -19,46 +21,29 @@ module Deliver
19
21
  @queue.push(job)
20
22
  end
21
23
 
24
+ # @param jobs (Array<Object>) - An array of arbitary object that keeps parameters
25
+ def batch_enqueue(jobs)
26
+ raise(ArgumentError, "Enqueue Array instead of #{jobs.class}") unless jobs.kind_of?(Array)
27
+ jobs.each { |job| enqueue(job) }
28
+ end
29
+
22
30
  # Call this after you enqueuned all the jobs you want to process
23
31
  # This method blocks current thread until all the enqueued jobs are processed
24
32
  def start
33
+ @queue.close
34
+
25
35
  threads = []
26
36
  @concurrency.times do
27
37
  threads << Thread.new do
28
- while running? && !empty?
38
+ job = @queue.pop
39
+ while job
40
+ @block.call(job)
29
41
  job = @queue.pop
30
- @block.call(job) if job
31
42
  end
32
43
  end
33
44
  end
34
45
 
35
- wait_for_complete
36
46
  threads.each(&:join)
37
47
  end
38
-
39
- private
40
-
41
- def running?
42
- !@queue.closed?
43
- end
44
-
45
- def empty?
46
- @queue.empty?
47
- end
48
-
49
- def wait_for_complete
50
- wait_thread = Thread.new do
51
- loop do
52
- if @queue.empty?
53
- @queue.close
54
- break
55
- end
56
-
57
- sleep(1)
58
- end
59
- end
60
-
61
- wait_thread.join
62
- end
63
48
  end
64
49
  end
@@ -1,4 +1,5 @@
1
1
  require_relative 'module'
2
+ require_relative 'queue_worker'
2
3
 
3
4
  module Deliver
4
5
  # upload description, rating, etc.
@@ -175,35 +176,48 @@ module Deliver
175
176
 
176
177
  non_localized_version_attributes['earliestReleaseDate'] = date
177
178
  Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
178
- elsif options[:automatic_release]
179
+ elsif options[:automatic_release] == true
179
180
  Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::AFTER_APPROVAL
180
- else
181
+ elsif options[:automatic_release] == false
181
182
  Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::MANUAL
182
183
  end
183
- non_localized_version_attributes['releaseType'] = release_type
184
+ if release_type.nil?
185
+ UI.important("Release type will not be set because neither `automatic_release` nor `auto_release_date` were provided. Please explicitly set one of these options if you need a release type set")
186
+ else
187
+ non_localized_version_attributes['releaseType'] = release_type
188
+ end
184
189
 
185
190
  # Update app store version
186
191
  # This needs to happen before updating localizations (https://openradar.appspot.com/radar?id=4925914991296512)
192
+ #
193
+ # Adding some sleeps because the API will sometimes be in a state where releaseType can't be modified
194
+ # https://github.com/fastlane/fastlane/issues/16911
187
195
  UI.message("Uploading metadata to App Store Connect for version")
196
+ sleep(2)
188
197
  version.update(attributes: non_localized_version_attributes)
198
+ sleep(1)
189
199
 
190
200
  # Update app store version localizations
191
- app_store_version_localizations.each do |app_store_version_localization|
201
+ store_version_worker = Deliver::QueueWorker.new do |app_store_version_localization|
192
202
  attributes = localized_version_attributes_by_locale[app_store_version_localization.locale]
193
203
  if attributes
194
204
  UI.message("Uploading metadata to App Store Connect for localized version '#{app_store_version_localization.locale}'")
195
205
  app_store_version_localization.update(attributes: attributes)
196
206
  end
197
207
  end
208
+ store_version_worker.batch_enqueue(app_store_version_localizations)
209
+ store_version_worker.start
198
210
 
199
211
  # Update app info localizations
200
- app_info_localizations.each do |app_info_localization|
212
+ app_info_worker = Deliver::QueueWorker.new do |app_info_localization|
201
213
  attributes = localized_info_attributes_by_locale[app_info_localization.locale]
202
214
  if attributes
203
215
  UI.message("Uploading metadata to App Store Connect for localized info '#{app_info_localization.locale}'")
204
216
  app_info_localization.update(attributes: attributes)
205
217
  end
206
218
  end
219
+ app_info_worker.batch_enqueue(app_info_localizations)
220
+ app_info_worker.start
207
221
 
208
222
  # Update categories
209
223
  app_info = fetch_edit_app_info(app)
@@ -13,8 +13,6 @@ module Deliver
13
13
  DeleteScreenshotJob = Struct.new(:app_screenshot, :localization, :app_screenshot_set)
14
14
  UploadScreenshotJob = Struct.new(:app_screenshot_set, :path)
15
15
 
16
- NUMBER_OF_THREADS = Helper.test? ? 1 : [ENV.fetch("DELIVER_NUMBER_OF_THREADS", 10).to_i, 10].min
17
-
18
16
  def upload(options, screenshots)
19
17
  return if options[:skip_screenshots]
20
18
  return if options[:edit_live]
@@ -69,7 +67,7 @@ module Deliver
69
67
  def delete_screenshots(localizations, screenshots_per_language, tries: 5)
70
68
  tries -= 1
71
69
 
72
- worker = QueueWorker.new(NUMBER_OF_THREADS) do |job|
70
+ worker = QueueWorker.new do |job|
73
71
  start_time = Time.now
74
72
  target = "#{job.localization.locale} #{job.app_screenshot_set.screenshot_display_type} #{job.app_screenshot.id}"
75
73
  begin
@@ -115,7 +113,7 @@ module Deliver
115
113
  tries -= 1
116
114
 
117
115
  # Upload screenshots
118
- worker = QueueWorker.new(NUMBER_OF_THREADS) do |job|
116
+ worker = QueueWorker.new do |job|
119
117
  begin
120
118
  UI.verbose("Uploading '#{job.path}'...")
121
119
  start_time = Time.now
@@ -236,7 +234,7 @@ module Deliver
236
234
  iterator = AppScreenshotIterator.new(localizations)
237
235
 
238
236
  # Re-order screenshots within app_screenshot_set
239
- worker = QueueWorker.new(NUMBER_OF_THREADS) do |app_screenshot_set|
237
+ worker = QueueWorker.new do |app_screenshot_set|
240
238
  original_ids = app_screenshot_set.app_screenshots.map(&:id)
241
239
  sorted_ids = app_screenshot_set.app_screenshots.sort_by(&:file_name).map(&:id)
242
240
  if original_ids != sorted_ids