fastlane 2.195.0 → 2.198.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +80 -80
  3. data/cert/lib/cert/runner.rb +5 -2
  4. data/deliver/lib/assets/ScreenshotsHelp +29 -6
  5. data/deliver/lib/deliver/app_screenshot.rb +5 -4
  6. data/deliver/lib/deliver/runner.rb +1 -1
  7. data/deliver/lib/deliver/upload_screenshots.rb +1 -1
  8. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +12 -6
  9. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +1 -1
  10. data/fastlane/lib/fastlane/actions/download_dsyms.rb +47 -30
  11. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/get_version_number.rb +6 -2
  13. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +2 -3
  14. data/fastlane/lib/fastlane/actions/notarize.rb +29 -11
  15. data/fastlane/lib/fastlane/actions/set_github_release.rb +11 -5
  16. data/fastlane/lib/fastlane/version.rb +1 -1
  17. data/fastlane/swift/Deliverfile.swift +1 -1
  18. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  19. data/fastlane/swift/Fastlane.swift +57 -17
  20. data/fastlane/swift/Gymfile.swift +1 -1
  21. data/fastlane/swift/GymfileProtocol.swift +5 -1
  22. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  23. data/fastlane/swift/Matchfile.swift +1 -1
  24. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  25. data/fastlane/swift/Precheckfile.swift +1 -1
  26. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  27. data/fastlane/swift/Runner.swift +1 -1
  28. data/fastlane/swift/Scanfile.swift +1 -1
  29. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  30. data/fastlane/swift/Screengrabfile.swift +1 -1
  31. data/fastlane/swift/ScreengrabfileProtocol.swift +3 -3
  32. data/fastlane/swift/Snapshotfile.swift +1 -1
  33. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  34. data/fastlane/swift/formatting/Brewfile.lock.json +27 -22
  35. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +38 -7
  36. data/frameit/lib/frameit/editor.rb +16 -18
  37. data/frameit/lib/frameit/trim_box.rb +6 -0
  38. data/gym/lib/gym/generators/build_command_generator.rb +1 -1
  39. data/gym/lib/gym/options.rb +6 -0
  40. data/match/lib/match/nuke.rb +79 -1
  41. data/match/lib/match/spaceship_ensure.rb +1 -0
  42. data/pem/lib/pem/manager.rb +31 -7
  43. data/pem/lib/pem/options.rb +10 -1
  44. data/pilot/lib/pilot/build_manager.rb +1 -1
  45. data/scan/lib/scan/runner.rb +1 -1
  46. data/screengrab/lib/screengrab/options.rb +2 -2
  47. data/sigh/lib/assets/resign.sh +8 -5
  48. data/snapshot/lib/snapshot/reports_generator.rb +8 -0
  49. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -2
  50. data/spaceship/lib/spaceship/connect_api/models/build_bundle.rb +59 -0
  51. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +3 -0
  52. data/spaceship/lib/spaceship/connect_api/testflight/.testflight.rb.swp +0 -0
  53. data/spaceship/lib/spaceship/connect_api/token.rb +1 -1
  54. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  55. data/supply/lib/supply/client.rb +3 -3
  56. data/supply/lib/supply/uploader.rb +1 -1
  57. metadata +38 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cd7eb437e3a1f8298553886732f358e31eef1c3cc91f43d39c8cfa47630962e
4
- data.tar.gz: 10e833b578831c678fa5515c12cc9fb18c9668d9296871e487571d92ceedeb53
3
+ metadata.gz: 77c8ce8c71c7b69c8de6e7e869ffdff958573d7d17dd7d1243851319694c32ec
4
+ data.tar.gz: 34d6fcfc8ca0405372ef957f33a536564833b63306a87287ac64a9594d055192
5
5
  SHA512:
6
- metadata.gz: 7bda6c9251396e39f8d88efe075f5684cdd22b6a144732cc472ee711e4b6b192f31a9fb7ec6a387a224d8904e0097596cc13f9cb1006d96d30048f3cba6cd56f
7
- data.tar.gz: 7a64bc28296e873afa02ac9af4f6c7d48d1d46c328a84218185b840e761f40cf5154385d390b10e024b8bd66a335a811fe9db0d09be2d1a7516f7c3d23c7d870
6
+ metadata.gz: 28443bb0c1c1360ede7cd0629321d7be3625aad5e0cee136815327d3809e9bccd137a312175ffdd51d4963b505683215cf59ad5704ad9ceab628b2ec49dcb12d
7
+ data.tar.gz: cbe5f2c64bd811f20a257f916c0c9bf64667f388582b2900f68bea33c0335ef1b79bd33c12873f3ecfc709a9515a548f0f67cb5ae5c266d4bf343c205e249096
data/README.md CHANGED
@@ -35,11 +35,11 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
35
35
  <!-- This table is regenerated and resorted on each release -->
36
36
  <table id='team'>
37
37
  <tr>
38
- <td id='daniel-jankowski'>
39
- <a href='https://github.com/mollyIV'>
40
- <img src='https://github.com/mollyIV.png' width='140px;'>
38
+ <td id='maksym-grebenets'>
39
+ <a href='https://github.com/mgrebenets'>
40
+ <img src='https://github.com/mgrebenets.png' width='140px;'>
41
41
  </a>
42
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
42
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
43
43
  </td>
44
44
  <td id='aaron-brager'>
45
45
  <a href='https://github.com/getaaron'>
@@ -47,37 +47,31 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
47
47
  </a>
48
48
  <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
49
49
  </td>
50
- <td id='jorge-revuelta-h'>
51
- <a href='https://github.com/minuscorp'>
52
- <img src='https://github.com/minuscorp.png' width='140px;'>
50
+ <td id='andrew-mcburney'>
51
+ <a href='https://github.com/armcburney'>
52
+ <img src='https://github.com/armcburney.png' width='140px;'>
53
53
  </a>
54
- <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
54
+ <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
55
55
  </td>
56
- <td id='danielle-tomlinson'>
57
- <a href='https://github.com/endocrimes'>
58
- <img src='https://github.com/endocrimes.png' width='140px;'>
56
+ <td id='fumiya-nakamura'>
57
+ <a href='https://github.com/nafu'>
58
+ <img src='https://github.com/nafu.png' width='140px;'>
59
59
  </a>
60
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
60
+ <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
61
61
  </td>
62
- <td id='jimmy-dee'>
63
- <a href='https://github.com/jdee'>
64
- <img src='https://github.com/jdee.png' width='140px;'>
62
+ <td id='matthew-ellis'>
63
+ <a href='https://github.com/matthewellis'>
64
+ <img src='https://github.com/matthewellis.png' width='140px;'>
65
65
  </a>
66
- <h4 align='center'>Jimmy Dee</h4>
66
+ <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
67
67
  </td>
68
68
  </tr>
69
69
  <tr>
70
- <td id='max-ott'>
71
- <a href='https://github.com/max-ott'>
72
- <img src='https://github.com/max-ott.png' width='140px;'>
73
- </a>
74
- <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
75
- </td>
76
- <td id='josh-holtz'>
77
- <a href='https://github.com/joshdholtz'>
78
- <img src='https://github.com/joshdholtz.png' width='140px;'>
70
+ <td id='jérôme-lacoste'>
71
+ <a href='https://github.com/lacostej'>
72
+ <img src='https://github.com/lacostej.png' width='140px;'>
79
73
  </a>
80
- <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
74
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
81
75
  </td>
82
76
  <td id='felix-krause'>
83
77
  <a href='https://github.com/KrauseFx'>
@@ -91,19 +85,31 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
91
85
  </a>
92
86
  <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
93
87
  </td>
94
- <td id='stefan-natchev'>
95
- <a href='https://github.com/snatchev'>
96
- <img src='https://github.com/snatchev.png' width='140px;'>
88
+ <td id='jan-piotrowski'>
89
+ <a href='https://github.com/janpio'>
90
+ <img src='https://github.com/janpio.png' width='140px;'>
97
91
  </a>
98
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
92
+ <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
93
+ </td>
94
+ <td id='satoshi-namai'>
95
+ <a href='https://github.com/ainame'>
96
+ <img src='https://github.com/ainame.png' width='140px;'>
97
+ </a>
98
+ <h4 align='center'><a href='https://twitter.com/ainame'>Satoshi Namai</a></h4>
99
99
  </td>
100
100
  </tr>
101
101
  <tr>
102
- <td id='matthew-ellis'>
103
- <a href='https://github.com/matthewellis'>
104
- <img src='https://github.com/matthewellis.png' width='140px;'>
102
+ <td id='manish-rathi'>
103
+ <a href='https://github.com/crazymanish'>
104
+ <img src='https://github.com/crazymanish.png' width='140px;'>
105
105
  </a>
106
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
106
+ <h4 align='center'><a href='https://twitter.com/iammanishrathi'>Manish Rathi</a></h4>
107
+ </td>
108
+ <td id='helmut-januschka'>
109
+ <a href='https://github.com/hjanuschka'>
110
+ <img src='https://github.com/hjanuschka.png' width='140px;'>
111
+ </a>
112
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
107
113
  </td>
108
114
  <td id='manu-wallner'>
109
115
  <a href='https://github.com/milch'>
@@ -117,43 +123,37 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
117
123
  </a>
118
124
  <h4 align='center'><a href='https://twitter.com/rogerluan_'>Roger Oba</a></h4>
119
125
  </td>
120
- <td id='joshua-liebowitz'>
121
- <a href='https://github.com/taquitos'>
122
- <img src='https://github.com/taquitos.png' width='140px;'>
123
- </a>
124
- <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
125
- </td>
126
- <td id='helmut-januschka'>
127
- <a href='https://github.com/hjanuschka'>
128
- <img src='https://github.com/hjanuschka.png' width='140px;'>
126
+ <td id='iulian-onofrei'>
127
+ <a href='https://github.com/revolter'>
128
+ <img src='https://github.com/revolter.png' width='140px;'>
129
129
  </a>
130
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
130
+ <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
131
131
  </td>
132
132
  </tr>
133
133
  <tr>
134
- <td id='fumiya-nakamura'>
135
- <a href='https://github.com/nafu'>
136
- <img src='https://github.com/nafu.png' width='140px;'>
134
+ <td id='jimmy-dee'>
135
+ <a href='https://github.com/jdee'>
136
+ <img src='https://github.com/jdee.png' width='140px;'>
137
137
  </a>
138
- <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
138
+ <h4 align='center'>Jimmy Dee</h4>
139
139
  </td>
140
- <td id='kohki-miki'>
141
- <a href='https://github.com/giginet'>
142
- <img src='https://github.com/giginet.png' width='140px;'>
140
+ <td id='joshua-liebowitz'>
141
+ <a href='https://github.com/taquitos'>
142
+ <img src='https://github.com/taquitos.png' width='140px;'>
143
143
  </a>
144
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
144
+ <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
145
145
  </td>
146
- <td id='jérôme-lacoste'>
147
- <a href='https://github.com/lacostej'>
148
- <img src='https://github.com/lacostej.png' width='140px;'>
146
+ <td id='max-ott'>
147
+ <a href='https://github.com/max-ott'>
148
+ <img src='https://github.com/max-ott.png' width='140px;'>
149
149
  </a>
150
- <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
150
+ <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
151
151
  </td>
152
- <td id='andrew-mcburney'>
153
- <a href='https://github.com/armcburney'>
154
- <img src='https://github.com/armcburney.png' width='140px;'>
152
+ <td id='stefan-natchev'>
153
+ <a href='https://github.com/snatchev'>
154
+ <img src='https://github.com/snatchev.png' width='140px;'>
155
155
  </a>
156
- <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
156
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
157
157
  </td>
158
158
  <td id='luka-mirosevic'>
159
159
  <a href='https://github.com/lmirosevic'>
@@ -163,35 +163,35 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
163
163
  </td>
164
164
  </tr>
165
165
  <tr>
166
- <td id='iulian-onofrei'>
167
- <a href='https://github.com/revolter'>
168
- <img src='https://github.com/revolter.png' width='140px;'>
166
+ <td id='kohki-miki'>
167
+ <a href='https://github.com/giginet'>
168
+ <img src='https://github.com/giginet.png' width='140px;'>
169
169
  </a>
170
- <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
170
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
171
171
  </td>
172
- <td id='maksym-grebenets'>
173
- <a href='https://github.com/mgrebenets'>
174
- <img src='https://github.com/mgrebenets.png' width='140px;'>
172
+ <td id='jorge-revuelta-h'>
173
+ <a href='https://github.com/minuscorp'>
174
+ <img src='https://github.com/minuscorp.png' width='140px;'>
175
175
  </a>
176
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
176
+ <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
177
177
  </td>
178
- <td id='manish-rathi'>
179
- <a href='https://github.com/crazymanish'>
180
- <img src='https://github.com/crazymanish.png' width='140px;'>
178
+ <td id='josh-holtz'>
179
+ <a href='https://github.com/joshdholtz'>
180
+ <img src='https://github.com/joshdholtz.png' width='140px;'>
181
181
  </a>
182
- <h4 align='center'><a href='https://twitter.com/iammanishrathi'>Manish Rathi</a></h4>
182
+ <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
183
183
  </td>
184
- <td id='jan-piotrowski'>
185
- <a href='https://github.com/janpio'>
186
- <img src='https://github.com/janpio.png' width='140px;'>
184
+ <td id='danielle-tomlinson'>
185
+ <a href='https://github.com/endocrimes'>
186
+ <img src='https://github.com/endocrimes.png' width='140px;'>
187
187
  </a>
188
- <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
188
+ <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
189
189
  </td>
190
- <td id='satoshi-namai'>
191
- <a href='https://github.com/ainame'>
192
- <img src='https://github.com/ainame.png' width='140px;'>
190
+ <td id='daniel-jankowski'>
191
+ <a href='https://github.com/mollyIV'>
192
+ <img src='https://github.com/mollyIV.png' width='140px;'>
193
193
  </a>
194
- <h4 align='center'><a href='https://twitter.com/ainame'>Satoshi Namai</a></h4>
194
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
195
195
  </td>
196
196
  </tr>
197
197
  </table>
@@ -154,8 +154,11 @@ module Cert
154
154
  when :developer_id_kext
155
155
  return Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_KEXT
156
156
  when :developer_id_installer
157
- raise "Cannot do with ASC API?"
158
- # return Spaceship.certificate.developer_id_installer
157
+ if !Spaceship::ConnectAPI.token.nil?
158
+ raise "As of 2021-11-09, the App Store Connect API does not allow accessing DEVELOPER_ID_INSTALLER with the API Key. Please file an issue on GitHub if this has changed and needs to be updated"
159
+ else
160
+ return Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_INSTALLER
161
+ end
159
162
  else
160
163
  UI.user_error("Unaccepted value for :type - #{Cert.config[:type]}")
161
164
  end
@@ -1,7 +1,30 @@
1
- Put all screenshots you want to use inside the folder of its language (e.g. en-US).
2
- The device type will automatically be recognized using the image resolution. Apple TV screenshots
3
- should be stored in a subdirectory named appleTV with language folders inside of it. iMessage
4
- screenshots, like Apple TV screenshots, should also be stored in a subdirectory named iMessage
5
- with language folders inside of it.
1
+ ## Screenshots Naming Rules
6
2
 
7
- The screenshots can be named whatever you want, but keep in mind they are sorted alphabetically.
3
+ Put all screenshots you want to use inside the folder of its language (e.g. `en-US`).
4
+ The device type will automatically be recognized using the image resolution.
5
+
6
+ The screenshots can be named whatever you want, but keep in mind they are sorted
7
+ alphabetically, in a human-friendly way. See https://github.com/fastlane/fastlane/pull/18200 for more details.
8
+
9
+ ### Exceptions
10
+
11
+ #### iPad Pro (3rd Gen) 12.9"
12
+
13
+ Since iPad Pro (3rd Gen) 12.9" and iPad Pro (2nd Gen) 12.9" have the same image
14
+ resolution, screenshots of the iPad Pro (3rd gen) 12.9" must contain either the
15
+ string `iPad Pro (12.9-inch) (3rd generation)`, `IPAD_PRO_3GEN_129`, or `ipadPro129`
16
+ (App Store Connect's internal naming of the display family for the 3rd generation iPad Pro)
17
+ in its filename to be assigned the correct display family and to be uploaded to
18
+ the correct screenshot slot in your app's metadata.
19
+
20
+ ### Other Platforms
21
+
22
+ #### Apple TV
23
+
24
+ Apple TV screenshots should be stored in a subdirectory named `appleTV` with language
25
+ folders inside of it.
26
+
27
+ #### iMessage
28
+
29
+ iMessage screenshots, like the Apple TV ones, should also be stored in a subdirectory
30
+ named `iMessage`, with language folders inside of it.
@@ -322,10 +322,11 @@ module Deliver
322
322
 
323
323
  def self.resolve_ipadpro_conflict_if_needed(screen_size, filename)
324
324
  is_3rd_gen = [
325
- "iPad Pro (12.9-inch) (3rd generation)", # default simulator name has this
326
- "iPad Pro (12.9-inch) (4th generation)", # default simulator name has this
327
- "ipadPro129", # downloaded screenshots name has this,
328
- "3GEN" # downloaded screenshots name from App Store Connect API has this
325
+ "iPad Pro (12.9-inch) (3rd generation)", # Default simulator has this name
326
+ "iPad Pro (12.9-inch) (4th generation)", # Default simulator has this name
327
+ "iPad Pro (12.9-inch) (5th generation)", # Default simulator has this name
328
+ "IPAD_PRO_3GEN_129", # Screenshots downloaded from App Store Connect has this name
329
+ "ipadPro129" # Legacy: screenshots downloaded from iTunes Connect used to have this name
329
330
  ].any? { |key| filename.include?(key) }
330
331
  if is_3rd_gen
331
332
  if screen_size == ScreenSize::IOS_IPAD_PRO
@@ -186,7 +186,7 @@ module Deliver
186
186
  end
187
187
 
188
188
  transporter = transporter_for_selected_team
189
- result = transporter.upload(package_path: package_path)
189
+ result = transporter.upload(package_path: package_path, asset_path: upload_ipa || upload_pkg)
190
190
 
191
191
  unless result
192
192
  transporter_errors = transporter.displayable_errors
@@ -157,7 +157,7 @@ module Deliver
157
157
 
158
158
  UI.verbose('Uploading jobs are completed')
159
159
 
160
- Helper.show_loading_indicator("Waiting for all the screenshots processed...")
160
+ Helper.show_loading_indicator("Waiting for all the screenshots to finish being processed...")
161
161
  states = wait_for_complete(iterator)
162
162
  Helper.hide_loading_indicator
163
163
  retry_upload_screenshots_if_needed(iterator, states, total_number_of_screenshots, tries, localizations, screenshots_per_language)
@@ -9,9 +9,18 @@ module Fastlane
9
9
 
10
10
  class AppStoreBuildNumberAction < Action
11
11
  def self.run(params)
12
+ build_v, build_nr = get_build_version_and_number(params)
13
+
14
+ Actions.lane_context[SharedValues::LATEST_BUILD_NUMBER] = build_nr
15
+ Actions.lane_context[SharedValues::LATEST_VERSION] = build_v
16
+
17
+ return build_nr
18
+ end
19
+
20
+ def self.get_build_version_and_number(params)
12
21
  require 'spaceship'
13
22
 
14
- result = get_build_number(params)
23
+ result = get_build_info(params)
15
24
  build_nr = result.build_nr
16
25
 
17
26
  # Convert build_nr to int (for legacy use) if no "." in string
@@ -19,13 +28,10 @@ module Fastlane
19
28
  build_nr = build_nr.to_i
20
29
  end
21
30
 
22
- Actions.lane_context[SharedValues::LATEST_BUILD_NUMBER] = build_nr
23
- Actions.lane_context[SharedValues::LATEST_VERSION] = result.build_v
24
-
25
- return build_nr
31
+ return result.build_v, build_nr
26
32
  end
27
33
 
28
- def self.get_build_number(params)
34
+ def self.get_build_info(params)
29
35
  # Prompts select team if multiple teams and none specified
30
36
  if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
31
37
  UI.message("Creating authorization token for App Store Connect API")
@@ -694,7 +694,7 @@ In this case, default values for keywords, urls, name and release notes are used
694
694
 
695
695
  [Starting March 20, 2019 Apple's App Store](https://developer.apple.com/news/?id=03202019a) requires 12.9-inch iPad Pro (3rd generation) screenshots additionally to the iPad Pro 2nd generation [screenshots](https://help.apple.com/app-store-connect/#/devd274dd925). As fastlane historically uses the screenshot dimensions to determine the "display family" of a screenshot, this poses a problem as both use the same dimensions and are recognized as the same device family.
696
696
 
697
- To solve this a screenshot of a 12.9-inch iPad Pro (3rd generation) must contain either the string `iPad Pro (12.9-inch) (3rd generation)` or `ipadPro129` (Apple's internal naming of the display family for the 3rd generation iPad Pro) in its filename to be assigned the correct display family and to be uploaded to the correct screenshot slot in your app's metadata.
697
+ To solve this a screenshot of a 12.9-inch iPad Pro (3rd generation) must contain either the string `iPad Pro (12.9-inch) (3rd generation)`, `IPAD_PRO_3GEN_129`, or `ipadPro129` (Apple's internal naming of the display family for the 3rd generation iPad Pro) in its filename to be assigned the correct display family and to be uploaded to the correct screenshot slot in your app's metadata.
698
698
 
699
699
  ## Automatically create screenshots
700
700
 
@@ -12,11 +12,18 @@ module Fastlane
12
12
  require 'net/http'
13
13
  require 'date'
14
14
 
15
- # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
16
- # Prompts select team if multiple teams and none specified
17
- UI.message("Login to App Store Connect (#{params[:username]})")
18
- Spaceship::ConnectAPI.login(params[:username], use_portal: false, use_tunes: true)
19
- UI.message("Login successful")
15
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
16
+ UI.message("Creating authorization token for App Store Connect API")
17
+ Spaceship::ConnectAPI.token = api_token
18
+ elsif !Spaceship::ConnectAPI.token.nil?
19
+ UI.message("Using existing authorization token for App Store Connect API")
20
+ else
21
+ # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
22
+ # Prompts select team if multiple teams and none specified
23
+ UI.message("Login to App Store Connect (#{params[:username]})")
24
+ Spaceship::ConnectAPI.login(params[:username], use_portal: false, use_tunes: true)
25
+ UI.message("Login successful")
26
+ end
20
27
 
21
28
  # Get App
22
29
  app = Spaceship::ConnectAPI::App.find(params[:app_identifier])
@@ -68,7 +75,7 @@ module Fastlane
68
75
 
69
76
  filter = { app: app.id }
70
77
  filter["preReleaseVersion.platform"] = platform
71
- build_resps = Spaceship::ConnectAPI.get_builds(filter: filter, sort: "-uploadedDate", includes: "preReleaseVersion").all_pages
78
+ build_resps = Spaceship::ConnectAPI.get_builds(filter: filter, sort: "-uploadedDate", includes: "preReleaseVersion,buildBundles").all_pages
72
79
  builds = build_resps.flat_map(&:to_models)
73
80
 
74
81
  builds.each do |build|
@@ -107,31 +114,24 @@ module Fastlane
107
114
  end
108
115
 
109
116
  UI.verbose("Build_version: #{asc_build_number} matches #{build_number}, grabbing dsym_url") if build_number
110
- get_details_and_download_dsym(app: app, train: asc_app_version, build_number: asc_build_number, uploaded_date: uploaded_date, platform: itc_platform, wait_for_dsym_processing: wait_for_dsym_processing, wait_timeout: wait_timeout, output_directory: output_directory)
117
+
118
+ build.build_bundles&.each do |build_bundle|
119
+ download_dsym(build_bundle: build_bundle, build: build, app: app, wait_for_dsym_processing: wait_for_dsym_processing, wait_timeout: wait_timeout, output_directory: output_directory)
120
+ end
111
121
  end
112
122
  end
113
123
 
114
- def self.get_details_and_download_dsym(app: nil, train: nil, build_number: nil, uploaded_date: nil, platform: nil, wait_for_dsym_processing: nil, wait_timeout: nil, output_directory: nil)
124
+ def self.download_dsym(build_bundle: nil, build: nil, app: nil, wait_for_dsym_processing: nil, wait_timeout: nil, output_directory: nil)
115
125
  start = Time.now
116
126
  download_url = nil
117
127
 
118
128
  loop do
119
- begin
120
- resp = Spaceship::Tunes.client.build_details(app_id: app.id, train: train, build_number: build_number, platform: platform)
121
-
122
- resp['apple_id'] = app.id
123
- build_details = Spaceship::Tunes::BuildDetails.factory(resp)
124
-
125
- download_url = build_details.dsym_url
126
- UI.verbose("dsym_url: #{download_url}")
127
- rescue Spaceship::TunesClient::ITunesConnectError => ex
128
- UI.error("Error accessing dSYM file for build\n\n#{build}\n\nException: #{ex}")
129
- end
129
+ download_url = build_bundle.dsym_url
130
130
 
131
131
  unless download_url
132
132
  if !wait_for_dsym_processing || (Time.now - start) > wait_timeout
133
133
  # In some cases, AppStoreConnect does not process the dSYMs, thus no error should be thrown.
134
- UI.message("Could not find any dSYM for #{build_number} (#{train})")
134
+ UI.message("Could not find any dSYM for #{build.version} (#{build.app_version})")
135
135
  else
136
136
  UI.message("Waiting for dSYM file to appear...")
137
137
  sleep(30)
@@ -143,10 +143,10 @@ module Fastlane
143
143
  end
144
144
 
145
145
  if download_url
146
- self.download(download_url, app.bundle_id, train, build_number, uploaded_date, output_directory)
147
- return if build_number
146
+ self.download(download_url, build, app, output_directory)
147
+ return if build.version
148
148
  else
149
- UI.message("No dSYM URL for #{build_number} (#{train})")
149
+ UI.message("No dSYM URL for #{build.version} (#{build.app_version})")
150
150
  end
151
151
  end
152
152
  # rubocop:enable Metrics/PerceivedComplexity
@@ -154,7 +154,7 @@ module Fastlane
154
154
  def self.get_latest_build!(app_id: nil, platform: nil)
155
155
  filter = { app: app_id }
156
156
  filter["preReleaseVersion.platform"] = platform
157
- latest_build = Spaceship::ConnectAPI.get_builds(filter: filter, sort: "-uploadedDate", includes: "preReleaseVersion").first
157
+ latest_build = Spaceship::ConnectAPI.get_builds(filter: filter, sort: "-uploadedDate", includes: "preReleaseVersion,buildBundles").first
158
158
 
159
159
  if latest_build.nil?
160
160
  UI.user_error!("Could not find any build for platform #{platform}") if platform
@@ -164,18 +164,18 @@ module Fastlane
164
164
  return latest_build
165
165
  end
166
166
 
167
- def self.download(download_url, bundle_id, train_number, build_version, uploaded_date, output_directory)
167
+ def self.download(download_url, build, app, output_directory)
168
168
  result = self.download_file(download_url)
169
- path = write_dsym(result, bundle_id, train_number, build_version, output_directory)
170
- UI.success("🔑 Successfully downloaded dSYM file for #{train_number} - #{build_version} to '#{path}'")
169
+ path = write_dsym(result, app.bundle_id, build.app_version, build.version, output_directory)
170
+ UI.success("🔑 Successfully downloaded dSYM file for #{build.app_version} - #{build.version} to '#{path}'")
171
171
 
172
172
  Actions.lane_context[SharedValues::DSYM_PATHS] ||= []
173
173
  Actions.lane_context[SharedValues::DSYM_PATHS] << File.expand_path(path)
174
174
 
175
- unless uploaded_date.nil?
176
- Actions.lane_context[SharedValues::DSYM_LATEST_UPLOADED_DATE] ||= uploaded_date
175
+ unless build.uploaded_date.nil?
176
+ Actions.lane_context[SharedValues::DSYM_LATEST_UPLOADED_DATE] ||= build.uploaded_date
177
177
  current_latest = Actions.lane_context[SharedValues::DSYM_LATEST_UPLOADED_DATE]
178
- Actions.lane_context[SharedValues::DSYM_LATEST_UPLOADED_DATE] = [current_latest, uploaded_date].max
178
+ Actions.lane_context[SharedValues::DSYM_LATEST_UPLOADED_DATE] = [current_latest, build.uploaded_date].max
179
179
  UI.verbose("Most recent build uploaded_date #{Actions.lane_context[SharedValues::DSYM_LATEST_UPLOADED_DATE]}")
180
180
  end
181
181
  end
@@ -234,6 +234,23 @@ module Fastlane
234
234
  user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
235
235
 
236
236
  [
237
+ FastlaneCore::ConfigItem.new(key: :api_key_path,
238
+ env_names: ["DOWNLOAD_DSYMS_API_KEY_PATH", "APP_STORE_CONNECT_API_KEY_PATH"],
239
+ description: "Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)",
240
+ optional: true,
241
+ conflicting_options: [:api_key],
242
+ verify_block: proc do |value|
243
+ UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value)
244
+ end),
245
+ FastlaneCore::ConfigItem.new(key: :api_key,
246
+ env_names: ["DOWNLOAD_DSYMS_API_KEY", "APP_STORE_CONNECT_API_KEY"],
247
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
248
+ type: Hash,
249
+ default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY],
250
+ default_value_dynamic: true,
251
+ optional: true,
252
+ sensitive: true,
253
+ conflicting_options: [:api_key_path]),
237
254
  FastlaneCore::ConfigItem.new(key: :username,
238
255
  short_option: "-u",
239
256
  env_name: "DOWNLOAD_DSYMS_USERNAME",
@@ -60,7 +60,7 @@ module Fastlane
60
60
  end
61
61
 
62
62
  def self.is_supported?(platform)
63
- platform == :ios
63
+ [:ios, :mac].include?(platform)
64
64
  end
65
65
 
66
66
  def self.example_code
@@ -109,8 +109,10 @@ module Fastlane
109
109
  options = plist_files.keys
110
110
  selected = UI.select("What build configuration would you like to use?", options)
111
111
  plist_file = plist_files[selected]
112
- else
112
+ elsif plist_files_count > 0
113
113
  plist_file = plist_files.values.first
114
+ else
115
+ return nil
114
116
  end
115
117
 
116
118
  # $(SRCROOT) is the path of where the XcodeProject is
@@ -131,6 +133,8 @@ module Fastlane
131
133
  end
132
134
 
133
135
  def self.get_version_number_from_plist!(plist_file)
136
+ return '$(MARKETING_VERSION)' if plist_file.nil?
137
+
134
138
  plist = Xcodeproj::Plist.read_from_path(plist_file)
135
139
  UI.user_error!("Unable to read plist: #{plist_file}") unless plist
136
140
 
@@ -146,7 +150,7 @@ module Fastlane
146
150
  end
147
151
 
148
152
  def self.details
149
- "This action will return the current version number set on your project."
153
+ "This action will return the current version number set on your project. It first looks in the plist and then for '$(MARKETING_VERSION)' in the build settings."
150
154
  end
151
155
 
152
156
  def self.available_options
@@ -9,9 +9,8 @@ module Fastlane
9
9
 
10
10
  class LatestTestflightBuildNumberAction < Action
11
11
  def self.run(params)
12
- AppStoreBuildNumberAction.run(params)
13
- build_nr = Actions.lane_context[SharedValues::LATEST_BUILD_NUMBER]
14
- build_v = Actions.lane_context[SharedValues::LATEST_VERSION]
12
+ build_v, build_nr = AppStoreBuildNumberAction.get_build_version_and_number(params)
13
+
15
14
  Actions.lane_context[SharedValues::LATEST_TESTFLIGHT_BUILD_NUMBER] = build_nr
16
15
  Actions.lane_context[SharedValues::LATEST_TESTFLIGHT_VERSION] = build_v
17
16
  return build_nr