fastlane 2.161.0 → 2.166.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 (103) hide show
  1. checksums.yaml +5 -5
  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/.upload_screenshots.rb.swp +0 -0
  6. data/deliver/lib/deliver/app_screenshot_iterator.rb +4 -4
  7. data/deliver/lib/deliver/module.rb +2 -0
  8. data/deliver/lib/deliver/options.rb +5 -5
  9. data/deliver/lib/deliver/queue_worker.rb +14 -29
  10. data/deliver/lib/deliver/upload_metadata.rb +20 -5
  11. data/deliver/lib/deliver/upload_screenshots.rb +28 -13
  12. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  13. data/fastlane/lib/fastlane/actions/actions_helper.rb +1 -1
  14. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +39 -3
  15. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +9 -0
  16. data/fastlane/lib/fastlane/actions/appledoc.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +1 -0
  18. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +5 -1
  19. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +9 -0
  20. data/fastlane/lib/fastlane/actions/get_certificates.rb +1 -0
  21. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +1 -0
  22. data/fastlane/lib/fastlane/actions/import_from_git.rb +9 -1
  23. data/fastlane/lib/fastlane/actions/is_ci.rb +1 -1
  24. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +15 -0
  25. data/fastlane/lib/fastlane/actions/register_device.rb +46 -5
  26. data/fastlane/lib/fastlane/actions/register_devices.rb +50 -16
  27. data/fastlane/lib/fastlane/actions/set_changelog.rb +31 -3
  28. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -0
  29. data/fastlane/lib/fastlane/actions/update_fastlane.rb +24 -8
  30. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -2
  31. data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
  32. data/fastlane/lib/fastlane/fast_file.rb +74 -23
  33. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -0
  34. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  35. data/fastlane/lib/fastlane/version.rb +1 -1
  36. data/fastlane/swift/Deliverfile.swift +1 -1
  37. data/fastlane/swift/DeliverfileProtocol.swift +4 -4
  38. data/fastlane/swift/Fastlane.swift +119 -23
  39. data/fastlane/swift/Gymfile.swift +1 -1
  40. data/fastlane/swift/GymfileProtocol.swift +1 -1
  41. data/fastlane/swift/LaneFileProtocol.swift +15 -19
  42. data/fastlane/swift/MainProcess.swift +1 -1
  43. data/fastlane/swift/Matchfile.swift +1 -1
  44. data/fastlane/swift/MatchfileProtocol.swift +20 -4
  45. data/fastlane/swift/Precheckfile.swift +1 -1
  46. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  47. data/fastlane/swift/Scanfile.swift +1 -1
  48. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  49. data/fastlane/swift/Screengrabfile.swift +1 -1
  50. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  51. data/fastlane/swift/Snapshotfile.swift +1 -1
  52. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  53. data/fastlane/swift/main.swift +1 -1
  54. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +6 -7
  55. data/fastlane_core/lib/fastlane_core/device_manager.rb +8 -4
  56. data/fastlane_core/lib/fastlane_core/helper.rb +10 -2
  57. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -3
  58. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +3 -3
  59. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  60. data/match/lib/match/generator.rb +6 -1
  61. data/match/lib/match/importer.rb +63 -18
  62. data/match/lib/match/migrate.rb +13 -2
  63. data/match/lib/match/nuke.rb +65 -22
  64. data/match/lib/match/options.rb +33 -2
  65. data/match/lib/match/runner.rb +38 -10
  66. data/match/lib/match/spaceship_ensure.rb +27 -21
  67. data/match/lib/match/storage/google_cloud_storage.rb +20 -3
  68. data/match/lib/match/storage/s3_storage.rb +19 -3
  69. data/scan/lib/scan/detect_values.rb +8 -9
  70. data/scan/lib/scan/module.rb +4 -0
  71. data/scan/lib/scan/options.rb +9 -0
  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/snapshot/lib/snapshot/test_command_generator.rb +1 -1
  80. data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
  81. data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +1 -1
  82. data/spaceship/lib/spaceship/client.rb +9 -4
  83. data/spaceship/lib/spaceship/connect_api.rb +27 -0
  84. data/spaceship/lib/spaceship/connect_api/api_client.rb +12 -3
  85. data/spaceship/lib/spaceship/connect_api/client.rb +20 -7
  86. data/spaceship/lib/spaceship/connect_api/models/app.rb +51 -0
  87. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +3 -1
  88. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +2 -1
  89. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +42 -0
  90. data/spaceship/lib/spaceship/connect_api/models/custom_app_organization.rb +43 -0
  91. data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
  92. data/spaceship/lib/spaceship/connect_api/models/device.rb +5 -0
  93. data/spaceship/lib/spaceship/connect_api/models/profile.rb +7 -1
  94. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +59 -0
  95. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +45 -2
  96. data/spaceship/lib/spaceship/connect_api/spaceship.rb +7 -4
  97. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  98. data/spaceship/lib/spaceship/connect_api/token.rb +6 -1
  99. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +71 -0
  100. data/spaceship/lib/spaceship/connect_api/users/users.rb +40 -0
  101. data/supply/lib/supply.rb +1 -1
  102. data/supply/lib/supply/uploader.rb +1 -1
  103. metadata +24 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: b04dd428b80beb70de6d4aa2f7e0348b4e0c0e1d4aa0e781c311ab18e44d0de5
4
- data.tar.gz: fe4342a1c8d7df3e617c111e37bd3cab7c7b3675875f8bd384917f0cafb1a221
2
+ SHA1:
3
+ metadata.gz: a087d077b77ba7df4a5d383d8d607aeda9f3b67e
4
+ data.tar.gz: 31a97905c7bf5685558efd65933780580b69f470
5
5
  SHA512:
6
- metadata.gz: 9ad358398a4033fe329a06934cee91566dd29c084a0e0e62a86148c0e2b456be46ce008de0b921a68b9d2ffbb3ec11d97a41a286d33cac395d3e4c37ac01adce
7
- data.tar.gz: 3d5fbd2690e8dafe1efc9fd4a6d63e711b3569b071d00d39b82e078a5c038c6110df73234d0e15ecc03c7f2792253edea430d6e716c460a7d8c9d371deed0dd0
6
+ metadata.gz: 155ad8ce03e385a45ebcd3ad1757fa6cc25ae2fda564819f01f61af4a2a871b78ee5a1b5510571516dd8e059482a8a53361aedf1ede90619fe64ce42dcde4cca
7
+ data.tar.gz: cc279dfeae02d6b401761bbdc08e0763a8f10fc7b36c9f1a6c5d369502432e87b4ff9bac93a30997dc5709f282e93962942622c65c05c644494f844f3c875b4f
data/README.md CHANGED
@@ -34,11 +34,29 @@ 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='stefan-natchev'>
38
- <a href='https://github.com/snatchev'>
39
- <img src='https://github.com/snatchev.png?size=140'>
37
+ <td id='max-ott'>
38
+ <a href='https://github.com/max-ott'>
39
+ <img src='https://github.com/max-ott.png?size=140'>
40
40
  </a>
41
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
41
+ <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
42
+ </td>
43
+ <td id='danielle-tomlinson'>
44
+ <a href='https://github.com/endocrimes'>
45
+ <img src='https://github.com/endocrimes.png?size=140'>
46
+ </a>
47
+ <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
48
+ </td>
49
+ <td id='jimmy-dee'>
50
+ <a href='https://github.com/jdee'>
51
+ <img src='https://github.com/jdee.png?size=140'>
52
+ </a>
53
+ <h4 align='center'>Jimmy Dee</h4>
54
+ </td>
55
+ <td id='daniel-jankowski'>
56
+ <a href='https://github.com/mollyIV'>
57
+ <img src='https://github.com/mollyIV.png?size=140'>
58
+ </a>
59
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
42
60
  </td>
43
61
  <td id='jorge-revuelta-h'>
44
62
  <a href='https://github.com/minuscorp'>
@@ -46,133 +64,115 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
46
64
  </a>
47
65
  <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
48
66
  </td>
49
- <td id='olivier-halligon'>
50
- <a href='https://github.com/AliSoftware'>
51
- <img src='https://github.com/AliSoftware.png?size=140'>
52
- </a>
53
- <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
54
- </td>
67
+ </tr>
68
+ <tr>
55
69
  <td id='fumiya-nakamura'>
56
70
  <a href='https://github.com/nafu'>
57
71
  <img src='https://github.com/nafu.png?size=140'>
58
72
  </a>
59
73
  <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
60
74
  </td>
61
- <td id='matthew-ellis'>
62
- <a href='https://github.com/matthewellis'>
63
- <img src='https://github.com/matthewellis.png?size=140'>
75
+ <td id='manu-wallner'>
76
+ <a href='https://github.com/milch'>
77
+ <img src='https://github.com/milch.png?size=140'>
64
78
  </a>
65
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
79
+ <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
66
80
  </td>
67
- </tr>
68
- <tr>
69
81
  <td id='aaron-brager'>
70
82
  <a href='https://github.com/getaaron'>
71
83
  <img src='https://github.com/getaaron.png?size=140'>
72
84
  </a>
73
85
  <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
74
86
  </td>
75
- <td id='max-ott'>
76
- <a href='https://github.com/max-ott'>
77
- <img src='https://github.com/max-ott.png?size=140'>
87
+ <td id='kohki-miki'>
88
+ <a href='https://github.com/giginet'>
89
+ <img src='https://github.com/giginet.png?size=140'>
78
90
  </a>
79
- <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
91
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
80
92
  </td>
81
- <td id='felix-krause'>
82
- <a href='https://github.com/KrauseFx'>
83
- <img src='https://github.com/KrauseFx.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'>
84
96
  </a>
85
- <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
97
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
86
98
  </td>
87
- <td id='luka-mirosevic'>
88
- <a href='https://github.com/lmirosevic'>
89
- <img src='https://github.com/lmirosevic.png?size=140'>
99
+ </tr>
100
+ <tr>
101
+ <td id='matthew-ellis'>
102
+ <a href='https://github.com/matthewellis'>
103
+ <img src='https://github.com/matthewellis.png?size=140'>
90
104
  </a>
91
- <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
105
+ <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
92
106
  </td>
93
- <td id='manu-wallner'>
94
- <a href='https://github.com/milch'>
95
- <img src='https://github.com/milch.png?size=140'>
107
+ <td id='joshua-liebowitz'>
108
+ <a href='https://github.com/taquitos'>
109
+ <img src='https://github.com/taquitos.png?size=140'>
96
110
  </a>
97
- <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
111
+ <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
112
+ </td>
113
+ <td id='jan-piotrowski'>
114
+ <a href='https://github.com/janpio'>
115
+ <img src='https://github.com/janpio.png?size=140'>
116
+ </a>
117
+ <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
98
118
  </td>
99
- </tr>
100
- <tr>
101
119
  <td id='iulian-onofrei'>
102
120
  <a href='https://github.com/revolter'>
103
121
  <img src='https://github.com/revolter.png?size=140'>
104
122
  </a>
105
123
  <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
106
124
  </td>
107
- <td id='jimmy-dee'>
108
- <a href='https://github.com/jdee'>
109
- <img src='https://github.com/jdee.png?size=140'>
110
- </a>
111
- <h4 align='center'>Jimmy Dee</h4>
112
- </td>
113
- <td id='andrew-mcburney'>
114
- <a href='https://github.com/armcburney'>
115
- <img src='https://github.com/armcburney.png?size=140'>
116
- </a>
117
- <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
118
- </td>
119
125
  <td id='maksym-grebenets'>
120
126
  <a href='https://github.com/mgrebenets'>
121
127
  <img src='https://github.com/mgrebenets.png?size=140'>
122
128
  </a>
123
129
  <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
124
130
  </td>
131
+ </tr>
132
+ <tr>
125
133
  <td id='josh-holtz'>
126
134
  <a href='https://github.com/joshdholtz'>
127
135
  <img src='https://github.com/joshdholtz.png?size=140'>
128
136
  </a>
129
137
  <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
130
138
  </td>
131
- </tr>
132
- <tr>
133
- <td id='jan-piotrowski'>
134
- <a href='https://github.com/janpio'>
135
- <img src='https://github.com/janpio.png?size=140'>
136
- </a>
137
- <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
138
- </td>
139
- <td id='danielle-tomlinson'>
140
- <a href='https://github.com/endocrimes'>
141
- <img src='https://github.com/endocrimes.png?size=140'>
139
+ <td id='jérôme-lacoste'>
140
+ <a href='https://github.com/lacostej'>
141
+ <img src='https://github.com/lacostej.png?size=140'>
142
142
  </a>
143
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
143
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
144
144
  </td>
145
- <td id='kohki-miki'>
146
- <a href='https://github.com/giginet'>
147
- <img src='https://github.com/giginet.png?size=140'>
145
+ <td id='andrew-mcburney'>
146
+ <a href='https://github.com/armcburney'>
147
+ <img src='https://github.com/armcburney.png?size=140'>
148
148
  </a>
149
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
149
+ <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
150
150
  </td>
151
- <td id='helmut-januschka'>
152
- <a href='https://github.com/hjanuschka'>
153
- <img src='https://github.com/hjanuschka.png?size=140'>
151
+ <td id='felix-krause'>
152
+ <a href='https://github.com/KrauseFx'>
153
+ <img src='https://github.com/KrauseFx.png?size=140'>
154
154
  </a>
155
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
155
+ <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
156
156
  </td>
157
- <td id='jérôme-lacoste'>
158
- <a href='https://github.com/lacostej'>
159
- <img src='https://github.com/lacostej.png?size=140'>
157
+ <td id='olivier-halligon'>
158
+ <a href='https://github.com/AliSoftware'>
159
+ <img src='https://github.com/AliSoftware.png?size=140'>
160
160
  </a>
161
- <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
161
+ <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
162
162
  </td>
163
163
  </tr>
164
164
  <tr>
165
- <td id='daniel-jankowski'>
166
- <a href='https://github.com/mollyIV'>
167
- <img src='https://github.com/mollyIV.png?size=140'>
165
+ <td id='stefan-natchev'>
166
+ <a href='https://github.com/snatchev'>
167
+ <img src='https://github.com/snatchev.png?size=140'>
168
168
  </a>
169
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
169
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
170
170
  </td>
171
- <td id='joshua-liebowitz'>
172
- <a href='https://github.com/taquitos'>
173
- <img src='https://github.com/taquitos.png?size=140'>
171
+ <td id='luka-mirosevic'>
172
+ <a href='https://github.com/lmirosevic'>
173
+ <img src='https://github.com/lmirosevic.png?size=140'>
174
174
  </a>
175
- <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</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.to_pem
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