fastlane 2.160.0 → 2.165.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +78 -78
  3. data/cert/lib/cert/options.rb +28 -1
  4. data/cert/lib/cert/runner.rb +51 -34
  5. data/deliver/lib/deliver/app_screenshot_iterator.rb +4 -4
  6. data/deliver/lib/deliver/module.rb +2 -0
  7. data/deliver/lib/deliver/options.rb +5 -5
  8. data/deliver/lib/deliver/queue_worker.rb +14 -29
  9. data/deliver/lib/deliver/upload_metadata.rb +20 -5
  10. data/deliver/lib/deliver/upload_screenshots.rb +28 -13
  11. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  12. data/fastlane/lib/fastlane/actions/actions_helper.rb +20 -1
  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 +15 -1
  15. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +1 -0
  16. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +2 -2
  17. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +2 -2
  18. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -1
  19. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +2 -2
  20. data/fastlane/lib/fastlane/actions/docs/run_tests.md +2 -2
  21. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +12 -3
  22. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -2
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +1 -1
  24. data/fastlane/lib/fastlane/actions/download_dsyms.rb +1 -0
  25. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +13 -2
  26. data/fastlane/lib/fastlane/actions/get_certificates.rb +1 -0
  27. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +1 -0
  28. data/fastlane/lib/fastlane/actions/import_from_git.rb +9 -1
  29. data/fastlane/lib/fastlane/actions/is_ci.rb +1 -1
  30. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +15 -0
  31. data/fastlane/lib/fastlane/actions/register_device.rb +46 -5
  32. data/fastlane/lib/fastlane/actions/register_devices.rb +50 -16
  33. data/fastlane/lib/fastlane/actions/set_changelog.rb +31 -3
  34. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -0
  35. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -2
  36. data/fastlane/lib/fastlane/fast_file.rb +74 -23
  37. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -0
  38. data/fastlane/lib/fastlane/version.rb +1 -1
  39. data/fastlane/swift/Deliverfile.swift +1 -1
  40. data/fastlane/swift/DeliverfileProtocol.swift +4 -4
  41. data/fastlane/swift/Fastlane.swift +120 -27
  42. data/fastlane/swift/Gymfile.swift +1 -1
  43. data/fastlane/swift/GymfileProtocol.swift +1 -1
  44. data/fastlane/swift/LaneFileProtocol.swift +28 -36
  45. data/fastlane/swift/MainProcess.swift +1 -1
  46. data/fastlane/swift/Matchfile.swift +1 -1
  47. data/fastlane/swift/MatchfileProtocol.swift +21 -5
  48. data/fastlane/swift/Precheckfile.swift +1 -1
  49. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  50. data/fastlane/swift/Scanfile.swift +1 -1
  51. data/fastlane/swift/ScanfileProtocol.swift +1 -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/main.swift +1 -1
  57. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +6 -7
  58. data/fastlane_core/lib/fastlane_core/device_manager.rb +8 -4
  59. data/fastlane_core/lib/fastlane_core/helper.rb +1 -1
  60. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +3 -3
  61. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  62. data/match/lib/match/generator.rb +6 -1
  63. data/match/lib/match/importer.rb +63 -18
  64. data/match/lib/match/migrate.rb +13 -2
  65. data/match/lib/match/nuke.rb +65 -22
  66. data/match/lib/match/options.rb +34 -3
  67. data/match/lib/match/runner.rb +38 -10
  68. data/match/lib/match/spaceship_ensure.rb +27 -21
  69. data/match/lib/match/storage/google_cloud_storage.rb +20 -3
  70. data/match/lib/match/storage/s3_storage.rb +19 -3
  71. data/scan/lib/scan/detect_values.rb +5 -8
  72. data/scan/lib/scan/runner.rb +2 -1
  73. data/sigh/lib/assets/resign.sh +1 -1
  74. data/sigh/lib/sigh/download_all.rb +16 -4
  75. data/sigh/lib/sigh/options.rb +21 -0
  76. data/sigh/lib/sigh/runner.rb +83 -41
  77. data/snapshot/lib/assets/SnapshotHelper.swift +4 -0
  78. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +2 -1
  79. data/spaceship/README.md +1 -1
  80. data/spaceship/lib/spaceship/client.rb +9 -4
  81. data/spaceship/lib/spaceship/connect_api.rb +27 -0
  82. data/spaceship/lib/spaceship/connect_api/api_client.rb +12 -3
  83. data/spaceship/lib/spaceship/connect_api/client.rb +20 -7
  84. data/spaceship/lib/spaceship/connect_api/models/app.rb +51 -0
  85. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +3 -1
  86. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +2 -1
  87. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +42 -0
  88. data/spaceship/lib/spaceship/connect_api/models/custom_app_organization.rb +43 -0
  89. data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
  90. data/spaceship/lib/spaceship/connect_api/models/device.rb +5 -0
  91. data/spaceship/lib/spaceship/connect_api/models/profile.rb +7 -1
  92. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +59 -0
  93. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +45 -2
  94. data/spaceship/lib/spaceship/connect_api/spaceship.rb +7 -4
  95. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  96. data/spaceship/lib/spaceship/connect_api/token.rb +6 -1
  97. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +75 -1
  98. data/spaceship/lib/spaceship/connect_api/users/users.rb +40 -0
  99. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +11 -5
  100. data/supply/lib/supply/uploader.rb +1 -1
  101. metadata +19 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1397a58b9e5db2690af6f035c6b0599471135fca731aa8ca32d9332e92aa0f4d
4
- data.tar.gz: 28074ccdc0e5948e4d2882d45207229fae454f5712d8a3448e7306bba339a81f
3
+ metadata.gz: 314c607226cc1a8a4f1c7e23e6087f11ba72d05d1b95c55b4dc2477bc1a7edbe
4
+ data.tar.gz: 211a75deb1403c2d94ee7542b48f361e88780251539d5fb57384da76f8914549
5
5
  SHA512:
6
- metadata.gz: 0cd4759b7d14605eba44cc49c2ba83989b4b2435ecc0b02d9ce7a162c10c67202504eec4ea4e4cd255f866b929419ee6f670828e6992b34a4845789a870daaea
7
- data.tar.gz: 9c1e740b44e8022f87ef2009caaad53bc2ea4c6eb00abe80477c8945bac056e0b6de7c88d90a8e1b85a4ad27ce62fd417b1529e4e1c97c52d321a0f269192cba
6
+ metadata.gz: 05e5e851c42e0ca60579a9a1379414f7d9e8d047657bdeb4d0bbf8714d5408fdd7e9d3dda15d6665ee5c886f92050d64265175baf0949d8ce0e61834ecabcc22
7
+ data.tar.gz: 6e0b825a88e2ec98614c26033752d7598bc5e52ba76d3b46cd23b9916ea1c92253192564ed6bd29eff6e2a29faebe5afcc29d5417ce89a65cbe35732884f56ea
data/README.md CHANGED
@@ -34,17 +34,17 @@ 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='fumiya-nakamura'>
38
- <a href='https://github.com/nafu'>
39
- <img src='https://github.com/nafu.png?size=140'>
37
+ <td id='joshua-liebowitz'>
38
+ <a href='https://github.com/taquitos'>
39
+ <img src='https://github.com/taquitos.png?size=140'>
40
40
  </a>
41
- <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
41
+ <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
42
42
  </td>
43
- <td id='stefan-natchev'>
44
- <a href='https://github.com/snatchev'>
45
- <img src='https://github.com/snatchev.png?size=140'>
43
+ <td id='danielle-tomlinson'>
44
+ <a href='https://github.com/endocrimes'>
45
+ <img src='https://github.com/endocrimes.png?size=140'>
46
46
  </a>
47
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
47
+ <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
48
48
  </td>
49
49
  <td id='andrew-mcburney'>
50
50
  <a href='https://github.com/armcburney'>
@@ -52,25 +52,25 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
52
52
  </a>
53
53
  <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
54
54
  </td>
55
- <td id='aaron-brager'>
56
- <a href='https://github.com/getaaron'>
57
- <img src='https://github.com/getaaron.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/getaaron'>Aaron Brager</a></h4>
59
+ <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
60
60
  </td>
61
- <td id='jimmy-dee'>
62
- <a href='https://github.com/jdee'>
63
- <img src='https://github.com/jdee.png?size=140'>
61
+ <td id='josh-holtz'>
62
+ <a href='https://github.com/joshdholtz'>
63
+ <img src='https://github.com/joshdholtz.png?size=140'>
64
64
  </a>
65
- <h4 align='center'>Jimmy Dee</h4>
65
+ <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
66
66
  </td>
67
67
  </tr>
68
68
  <tr>
69
- <td id='maksym-grebenets'>
70
- <a href='https://github.com/mgrebenets'>
71
- <img src='https://github.com/mgrebenets.png?size=140'>
69
+ <td id='max-ott'>
70
+ <a href='https://github.com/max-ott'>
71
+ <img src='https://github.com/max-ott.png?size=140'>
72
72
  </a>
73
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
73
+ <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
74
74
  </td>
75
75
  <td id='felix-krause'>
76
76
  <a href='https://github.com/KrauseFx'>
@@ -78,101 +78,101 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
78
78
  </a>
79
79
  <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
80
80
  </td>
81
- <td id='max-ott'>
82
- <a href='https://github.com/max-ott'>
83
- <img src='https://github.com/max-ott.png?size=140'>
81
+ <td id='jan-piotrowski'>
82
+ <a href='https://github.com/janpio'>
83
+ <img src='https://github.com/janpio.png?size=140'>
84
84
  </a>
85
- <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
85
+ <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
86
86
  </td>
87
- <td id='jorge-revuelta-h'>
88
- <a href='https://github.com/minuscorp'>
89
- <img src='https://github.com/minuscorp.png?size=140'>
87
+ <td id='jérôme-lacoste'>
88
+ <a href='https://github.com/lacostej'>
89
+ <img src='https://github.com/lacostej.png?size=140'>
90
90
  </a>
91
- <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
91
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
92
92
  </td>
93
- <td id='kohki-miki'>
94
- <a href='https://github.com/giginet'>
95
- <img src='https://github.com/giginet.png?size=140'>
93
+ <td id='helmut-januschka'>
94
+ <a href='https://github.com/hjanuschka'>
95
+ <img src='https://github.com/hjanuschka.png?size=140'>
96
96
  </a>
97
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
97
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
98
98
  </td>
99
99
  </tr>
100
100
  <tr>
101
- <td id='joshua-liebowitz'>
102
- <a href='https://github.com/taquitos'>
103
- <img src='https://github.com/taquitos.png?size=140'>
104
- </a>
105
- <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
106
- </td>
107
101
  <td id='olivier-halligon'>
108
102
  <a href='https://github.com/AliSoftware'>
109
103
  <img src='https://github.com/AliSoftware.png?size=140'>
110
104
  </a>
111
105
  <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
112
106
  </td>
113
- <td id='daniel-jankowski'>
114
- <a href='https://github.com/mollyIV'>
115
- <img src='https://github.com/mollyIV.png?size=140'>
107
+ <td id='iulian-onofrei'>
108
+ <a href='https://github.com/revolter'>
109
+ <img src='https://github.com/revolter.png?size=140'>
116
110
  </a>
117
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
111
+ <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
118
112
  </td>
119
- <td id='jan-piotrowski'>
120
- <a href='https://github.com/janpio'>
121
- <img src='https://github.com/janpio.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/Sujan'>Jan Piotrowski</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='aaron-brager'>
120
+ <a href='https://github.com/getaaron'>
121
+ <img src='https://github.com/getaaron.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/getaaron'>Aaron Brager</a></h4>
124
+ </td>
125
+ <td id='jimmy-dee'>
126
+ <a href='https://github.com/jdee'>
127
+ <img src='https://github.com/jdee.png?size=140'>
128
+ </a>
129
+ <h4 align='center'>Jimmy Dee</h4>
130
130
  </td>
131
131
  </tr>
132
132
  <tr>
133
- <td id='josh-holtz'>
134
- <a href='https://github.com/joshdholtz'>
135
- <img src='https://github.com/joshdholtz.png?size=140'>
133
+ <td id='daniel-jankowski'>
134
+ <a href='https://github.com/mollyIV'>
135
+ <img src='https://github.com/mollyIV.png?size=140'>
136
136
  </a>
137
- <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
137
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
138
138
  </td>
139
- <td id='helmut-januschka'>
140
- <a href='https://github.com/hjanuschka'>
141
- <img src='https://github.com/hjanuschka.png?size=140'>
139
+ <td id='stefan-natchev'>
140
+ <a href='https://github.com/snatchev'>
141
+ <img src='https://github.com/snatchev.png?size=140'>
142
142
  </a>
143
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
143
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
144
144
  </td>
145
- <td id='matthew-ellis'>
146
- <a href='https://github.com/matthewellis'>
147
- <img src='https://github.com/matthewellis.png?size=140'>
145
+ <td id='manu-wallner'>
146
+ <a href='https://github.com/milch'>
147
+ <img src='https://github.com/milch.png?size=140'>
148
148
  </a>
149
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
149
+ <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
150
150
  </td>
151
- <td id='danielle-tomlinson'>
152
- <a href='https://github.com/endocrimes'>
153
- <img src='https://github.com/endocrimes.png?size=140'>
151
+ <td id='luka-mirosevic'>
152
+ <a href='https://github.com/lmirosevic'>
153
+ <img src='https://github.com/lmirosevic.png?size=140'>
154
154
  </a>
155
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
155
+ <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
156
156
  </td>
157
- <td id='iulian-onofrei'>
158
- <a href='https://github.com/revolter'>
159
- <img src='https://github.com/revolter.png?size=140'>
157
+ <td id='kohki-miki'>
158
+ <a href='https://github.com/giginet'>
159
+ <img src='https://github.com/giginet.png?size=140'>
160
160
  </a>
161
- <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
161
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</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='maksym-grebenets'>
166
+ <a href='https://github.com/mgrebenets'>
167
+ <img src='https://github.com/mgrebenets.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/mgrebenets'>Maksym Grebenets</a></h4>
170
170
  </td>
171
- <td id='jérôme-lacoste'>
172
- <a href='https://github.com/lacostej'>
173
- <img src='https://github.com/lacostej.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/lacostej'>Jérôme Lacoste</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
176
176
  </td>
177
177
  </table>
178
178
 
@@ -21,7 +21,7 @@ module Cert
21
21
  optional: true,
22
22
  verify_block: proc do |value|
23
23
  value = value.to_s
24
- types = %w(mac_installer_distribution developer_id_installer developer_id_application)
24
+ types = %w(mac_installer_distribution developer_id_installer developer_id_application developer_id_kext)
25
25
  UI.user_error!("Unsupported types, must be: #{types}") unless types.include?(value)
26
26
  end),
27
27
  FastlaneCore::ConfigItem.new(key: :force,
@@ -35,6 +35,25 @@ module Cert
35
35
  type: Boolean,
36
36
  default_value: FastlaneCore::Helper.mac? && FastlaneCore::Helper.xcode_at_least?('11'),
37
37
  default_value_dynamic: true),
38
+
39
+ # App Store Connect API
40
+ FastlaneCore::ConfigItem.new(key: :api_key_path,
41
+ env_name: "DELIVER_API_KEY_PATH",
42
+ 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)",
43
+ optional: true,
44
+ conflicting_options: [:api_key],
45
+ verify_block: proc do |value|
46
+ UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value)
47
+ end),
48
+ FastlaneCore::ConfigItem.new(key: :api_key,
49
+ env_name: "DELIVER_API_KEY",
50
+ 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)",
51
+ type: Hash,
52
+ optional: true,
53
+ sensitive: true,
54
+ conflicting_options: [:api_key_path]),
55
+
56
+ # Apple ID
38
57
  FastlaneCore::ConfigItem.new(key: :username,
39
58
  short_option: "-u",
40
59
  env_name: "CERT_USERNAME",
@@ -63,6 +82,8 @@ module Cert
63
82
  verify_block: proc do |value|
64
83
  ENV["FASTLANE_TEAM_NAME"] = value.to_s
65
84
  end),
85
+
86
+ # Other Options
66
87
  FastlaneCore::ConfigItem.new(key: :filename,
67
88
  short_option: "-q",
68
89
  env_name: "CERT_FILE_NAME",
@@ -90,6 +111,12 @@ module Cert
90
111
  sensitive: true,
91
112
  description: "This might be required the first time you access certificates on a new mac. For the login/default keychain this is your account password",
92
113
  optional: true),
114
+ FastlaneCore::ConfigItem.new(key: :skip_set_partition_list,
115
+ short_option: "-P",
116
+ env_name: "CERT_SKIP_SET_PARTITION_LIST",
117
+ description: "Skips setting the partition list (which can sometimes take a long time). Setting the partition list is usually needed to prevent Xcode from prompting to allow a cert to be used for signing",
118
+ type: Boolean,
119
+ default_value: false),
93
120
  FastlaneCore::ConfigItem.new(key: :platform,
94
121
  env_name: "CERT_PLATFORM",
95
122
  description: "Set the provisioning profile's platform (ios, macos)",
@@ -20,10 +20,20 @@ module Cert
20
20
  end
21
21
 
22
22
  def login
23
- UI.message("Starting login with user '#{Cert.config[:username]}'")
24
- Spaceship.login(Cert.config[:username], nil)
25
- Spaceship.select_team
26
- UI.message("Successfully logged in")
23
+ if api_token
24
+ UI.message("Creating authorization token for App Store Connect API")
25
+ Spaceship::ConnectAPI.token = api_token
26
+ else
27
+ UI.message("Starting login with user '#{Cert.config[:username]}'")
28
+ Spaceship::ConnectAPI.login(Cert.config[:username], nil, use_portal: true, use_tunes: false)
29
+ UI.message("Successfully logged in")
30
+ end
31
+ end
32
+
33
+ def api_token
34
+ @api_token ||= Spaceship::ConnectAPI::Token.create(Cert.config[:api_key]) if Cert.config[:api_key]
35
+ @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(Cert.config[:api_key_path]) if Cert.config[:api_key_path]
36
+ return @api_token
27
37
  end
28
38
 
29
39
  def run
@@ -65,11 +75,11 @@ module Cert
65
75
 
66
76
  to_revoke.each do |certificate|
67
77
  begin
68
- UI.message("#{certificate.id} #{certificate.name} has expired, revoking...")
69
- certificate.revoke!
78
+ UI.message("#{certificate.id} #{certificate.display_name} has expired, revoking...")
79
+ certificate.delete!
70
80
  revoke_count += 1
71
81
  rescue => e
72
- UI.error("An error occurred while revoking #{certificate.id} #{certificate.name}")
82
+ UI.error("An error occurred while revoking #{certificate.id} #{certificate.display_name}")
73
83
  UI.error("#{e.message}\n#{e.backtrace.join("\n")}") if FastlaneCore::Globals.verbose?
74
84
  end
75
85
  end
@@ -78,14 +88,12 @@ module Cert
78
88
  end
79
89
 
80
90
  def expired_certs
81
- certificates.select do |certificate|
82
- certificate.expires < Time.now.utc
83
- end
91
+ certificates.reject(&:valid?)
84
92
  end
85
93
 
86
94
  def find_existing_cert
87
95
  certificates.each do |certificate|
88
- unless certificate.can_download
96
+ unless certificate.certificate_content
89
97
  next
90
98
  end
91
99
 
@@ -101,23 +109,23 @@ module Cert
101
109
  ENV["CER_FILE_PATH"] = path
102
110
  ENV["CER_KEYCHAIN_PATH"] = keychain
103
111
 
104
- UI.success("Found the certificate #{certificate.id} (#{certificate.name}) which is installed on the local machine. Using this one.")
112
+ UI.success("Found the certificate #{certificate.id} (#{certificate.display_name}) which is installed on the local machine. Using this one.")
105
113
 
106
114
  return path
107
115
  elsif File.exist?(private_key_path)
108
116
  password = Cert.config[:keychain_password]
109
- FastlaneCore::KeychainImporter.import_file(private_key_path, keychain, keychain_password: password)
110
- FastlaneCore::KeychainImporter.import_file(path, keychain, keychain_password: password)
117
+ FastlaneCore::KeychainImporter.import_file(private_key_path, keychain, keychain_password: password, skip_set_partition_list: Cert.config[:skip_set_partition_list])
118
+ FastlaneCore::KeychainImporter.import_file(path, keychain, keychain_password: password, skip_set_partition_list: Cert.config[:skip_set_partition_list])
111
119
 
112
120
  ENV["CER_CERTIFICATE_ID"] = certificate.id
113
121
  ENV["CER_FILE_PATH"] = path
114
122
  ENV["CER_KEYCHAIN_PATH"] = keychain
115
123
 
116
- UI.success("Found the cached certificate #{certificate.id} (#{certificate.name}). Using this one.")
124
+ UI.success("Found the cached certificate #{certificate.id} (#{certificate.display_name}). Using this one.")
117
125
 
118
126
  return path
119
127
  else
120
- UI.error("Certificate #{certificate.id} (#{certificate.name}) can't be found on your local computer")
128
+ UI.error("Certificate #{certificate.id} (#{certificate.display_name}) can't be found on your local computer")
121
129
  end
122
130
 
123
131
  File.delete(path) # as apparently this certificate is pretty useless without a private key
@@ -129,7 +137,10 @@ module Cert
129
137
 
130
138
  # All certificates of this type
131
139
  def certificates
132
- certificate_type.all
140
+ filter = {
141
+ certificateType: certificate_type
142
+ }
143
+ return Spaceship::ConnectAPI::Certificate.all(filter: filter)
133
144
  end
134
145
 
135
146
  # The kind of certificate we're interested in
@@ -137,11 +148,14 @@ module Cert
137
148
  if Cert.config[:type]
138
149
  case Cert.config[:type].to_sym
139
150
  when :mac_installer_distribution
140
- return Spaceship.certificate.mac_installer_distribution
151
+ return Spaceship::ConnectAPI::Certificate::CertificateType::MAC_INSTALLER_DISTRIBUTION
141
152
  when :developer_id_application
142
- return Spaceship.certificate.developer_id_application
153
+ return Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_APPLICATION
154
+ when :developer_id_kext
155
+ return Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_KEXT
143
156
  when :developer_id_installer
144
- return Spaceship.certificate.developer_id_installer
157
+ raise "Cannot do with ASC API?"
158
+ # return Spaceship.certificate.developer_id_installer
145
159
  else
146
160
  UI.user_error("Unaccepted value for :type - #{Cert.config[:type]}")
147
161
  end
@@ -149,19 +163,19 @@ module Cert
149
163
 
150
164
  # Check if apple certs (Xcode 11 and later) should be used
151
165
  if Cert.config[:generate_apple_certs]
152
- cert_type = Spaceship.certificate.apple_distribution
153
- cert_type = Spaceship.certificate.in_house if Spaceship.client.in_house? # Enterprise doesn't use Apple Distribution
154
- cert_type = Spaceship.certificate.apple_development if Cert.config[:development]
166
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::DISTRIBUTION
167
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION if Spaceship::ConnectAPI.client.in_house? # Enterprise doesn't use Apple Distribution
168
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPMENT if Cert.config[:development]
155
169
  else
156
170
  case Cert.config[:platform].to_s
157
171
  when 'ios', 'tvos'
158
- cert_type = Spaceship.certificate.production
159
- cert_type = Spaceship.certificate.in_house if Spaceship.client.in_house?
160
- cert_type = Spaceship.certificate.development if Cert.config[:development]
172
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION
173
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION if Spaceship::ConnectAPI.client.in_house?
174
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DEVELOPMENT if Cert.config[:development]
161
175
 
162
176
  when 'macos'
163
- cert_type = Spaceship.certificate.mac_app_distribution
164
- cert_type = Spaceship.certificate.mac_development if Cert.config[:development]
177
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::MAC_APP_DISTRIBUTION
178
+ cert_type = Spaceship::ConnectAPI::Certificate::CertificateType::MAC_APP_DEVELOPMENT if Cert.config[:development]
165
179
  end
166
180
  end
167
181
 
@@ -170,11 +184,14 @@ module Cert
170
184
 
171
185
  def create_certificate
172
186
  # Create a new certificate signing request
173
- csr, pkey = Spaceship.certificate.create_certificate_signing_request
187
+ csr, pkey = Spaceship::ConnectAPI::Certificate.create_certificate_signing_request
174
188
 
175
189
  # Use the signing request to create a new (development|distribution) certificate
176
190
  begin
177
- certificate = certificate_type.create!(csr: csr)
191
+ certificate = Spaceship::ConnectAPI::Certificate.create(
192
+ certificate_type: certificate_type,
193
+ csr_content: csr
194
+ )
178
195
  rescue => ex
179
196
  type_name = (Cert.config[:development] ? "Development" : "Distribution")
180
197
  if ex.to_s.include?("You already have a current")
@@ -198,8 +215,8 @@ module Cert
198
215
  # Import all the things into the Keychain
199
216
  keychain = File.expand_path(Cert.config[:keychain_path])
200
217
  password = Cert.config[:keychain_password]
201
- FastlaneCore::KeychainImporter.import_file(private_key_path, keychain, keychain_password: password)
202
- FastlaneCore::KeychainImporter.import_file(cert_path, keychain, keychain_password: password)
218
+ FastlaneCore::KeychainImporter.import_file(private_key_path, keychain, keychain_password: password, skip_set_partition_list: Cert.config[:skip_set_partition_list])
219
+ FastlaneCore::KeychainImporter.import_file(cert_path, keychain, keychain_password: password, skip_set_partition_list: Cert.config[:skip_set_partition_list])
203
220
 
204
221
  # Environment variables for the fastlane action
205
222
  ENV["CER_CERTIFICATE_ID"] = certificate.id
@@ -214,8 +231,8 @@ module Cert
214
231
  cert_name = filename ? filename : certificate.id
215
232
  cert_name = "#{cert_name}.cer" unless File.extname(cert_name) == ".cer"
216
233
  path = File.expand_path(File.join(Cert.config[:output_path], cert_name))
217
- raw_data = certificate.download_raw
218
- File.write(path, raw_data)
234
+ raw_data = Base64.decode64(certificate.certificate_content)
235
+ File.write(path, raw_data.force_encoding("UTF-8"))
219
236
  return path
220
237
  end
221
238
  end