fastlane 2.157.4 → 2.162.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +80 -80
  3. data/cert/lib/cert/options.rb +28 -1
  4. data/cert/lib/cert/runner.rb +50 -33
  5. data/deliver/lib/deliver/app_screenshot_iterator.rb +4 -4
  6. data/deliver/lib/deliver/options.rb +17 -1
  7. data/deliver/lib/deliver/runner.rb +36 -7
  8. data/deliver/lib/deliver/upload_metadata.rb +37 -6
  9. data/deliver/lib/deliver/upload_price_tier.rb +7 -2
  10. data/deliver/lib/deliver/upload_screenshots.rb +25 -8
  11. data/{pilot/lib/pilot/.manager.rb.swp → fastlane/lib/fastlane/.erb_template_helper.rb.swp} +0 -0
  12. data/fastlane/lib/fastlane/actions/{.ensure_git_status_clean.rb.swp → .git_commit.rb.swp} +0 -0
  13. data/fastlane/lib/fastlane/actions/actions_helper.rb +20 -1
  14. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +6 -1
  15. data/fastlane/lib/fastlane/actions/clean_build_artifacts.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 +1 -1
  18. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -1
  19. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +3 -2
  20. data/fastlane/lib/fastlane/actions/docs/run_tests.md +2 -2
  21. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +3 -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 +2 -2
  24. data/fastlane/lib/fastlane/actions/download_dsyms.rb +32 -7
  25. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +13 -2
  26. data/fastlane/lib/fastlane/helper/git_helper.rb +2 -0
  27. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +6 -4
  28. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  29. data/fastlane/lib/fastlane/version.rb +1 -1
  30. data/fastlane/swift/Actions.swift +2 -1
  31. data/fastlane/swift/Appfile.swift +2 -4
  32. data/fastlane/swift/ArgumentProcessor.swift +2 -6
  33. data/fastlane/swift/ControlCommand.swift +2 -5
  34. data/fastlane/swift/Deliverfile.swift +5 -2
  35. data/fastlane/swift/DeliverfileProtocol.swift +15 -4
  36. data/fastlane/swift/Fastfile.swift +5 -1
  37. data/fastlane/swift/Fastlane.swift +2333 -2240
  38. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +5 -5
  39. data/fastlane/swift/Gymfile.swift +5 -2
  40. data/fastlane/swift/GymfileProtocol.swift +6 -3
  41. data/fastlane/swift/LaneFileProtocol.swift +42 -29
  42. data/fastlane/swift/MainProcess.swift +77 -0
  43. data/fastlane/swift/Matchfile.swift +5 -2
  44. data/fastlane/swift/MatchfileProtocol.swift +21 -6
  45. data/fastlane/swift/Plugins.swift +2 -1
  46. data/fastlane/swift/Precheckfile.swift +5 -2
  47. data/fastlane/swift/PrecheckfileProtocol.swift +18 -3
  48. data/fastlane/swift/RubyCommand.swift +2 -6
  49. data/fastlane/swift/RubyCommandable.swift +2 -6
  50. data/fastlane/swift/Runner.swift +5 -9
  51. data/fastlane/swift/RunnerArgument.swift +2 -6
  52. data/fastlane/swift/Scanfile.swift +5 -2
  53. data/fastlane/swift/ScanfileProtocol.swift +6 -3
  54. data/fastlane/swift/Screengrabfile.swift +5 -2
  55. data/fastlane/swift/ScreengrabfileProtocol.swift +6 -3
  56. data/fastlane/swift/Snapshotfile.swift +5 -2
  57. data/fastlane/swift/SnapshotfileProtocol.swift +6 -3
  58. data/fastlane/swift/SocketClient.swift +3 -7
  59. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -6
  60. data/fastlane/swift/SocketResponse.swift +2 -6
  61. data/fastlane/swift/formatting/Brewfile.lock.json +18 -10
  62. data/fastlane/swift/main.swift +4 -8
  63. data/fastlane/swift/upgrade_manifest.json +1 -1
  64. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +6 -7
  65. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +2 -2
  66. data/frameit/lib/frameit/editor.rb +1 -0
  67. data/match/lib/match/generator.rb +6 -1
  68. data/match/lib/match/importer.rb +44 -8
  69. data/match/lib/match/migrate.rb +13 -2
  70. data/match/lib/match/nuke.rb +65 -22
  71. data/match/lib/match/options.rb +27 -2
  72. data/match/lib/match/runner.rb +38 -10
  73. data/match/lib/match/spaceship_ensure.rb +27 -21
  74. data/match/lib/match/storage/google_cloud_storage.rb +20 -3
  75. data/match/lib/match/storage/s3_storage.rb +19 -3
  76. data/pilot/lib/pilot/options.rb +2 -2
  77. data/precheck/lib/precheck/options.rb +25 -0
  78. data/precheck/lib/precheck/rule_processor.rb +94 -60
  79. data/precheck/lib/precheck/runner.rb +26 -5
  80. data/sigh/lib/sigh/options.rb +21 -0
  81. data/sigh/lib/sigh/runner.rb +80 -38
  82. data/snapshot/lib/assets/SnapshotHelper.swift +17 -2
  83. data/spaceship/README.md +1 -1
  84. data/spaceship/lib/spaceship/{connect_api/.DS_Store → .DS_Store} +0 -0
  85. data/spaceship/lib/spaceship/client.rb +2 -1
  86. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  87. data/spaceship/lib/spaceship/connect_api/api_client.rb +3 -3
  88. data/spaceship/lib/spaceship/connect_api/client.rb +38 -15
  89. data/{fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp → spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp} +0 -0
  90. data/spaceship/lib/spaceship/connect_api/models/app.rb +17 -9
  91. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  92. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +3 -1
  93. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +2 -2
  94. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +3 -5
  95. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +3 -5
  96. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +21 -0
  97. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +2 -1
  98. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +42 -0
  99. data/spaceship/lib/spaceship/connect_api/models/profile.rb +7 -1
  100. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +59 -0
  101. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +28 -2
  102. data/spaceship/lib/spaceship/connect_api/spaceship.rb +3 -2
  103. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  104. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +29 -9
  105. data/spaceship/lib/spaceship/connect_api/users/users.rb +40 -0
  106. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +11 -5
  107. metadata +24 -25
  108. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  109. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  110. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 724ffba6ca23aa124bf2c5493e9bb4eda084ce2361eb9c1ee2db3eb04c3a25cc
4
- data.tar.gz: 51d3469c018497d533e66922626264fe6b561b71ec30351a1c578e500ed2b7fa
3
+ metadata.gz: cfbc3b8babe2db6398b23a113db895f79eea46daa635909a2146e2df6ab4fa2d
4
+ data.tar.gz: d643dd677d37e514523433380eb65dc67798ec67cb9c4726c33e84529156b337
5
5
  SHA512:
6
- metadata.gz: e4f3bd7df2c383ae03f2550a9a7847e2913d3d6a048ad7efa14e4bf145156da2590b5c75c12eb303d14e6aaa838be7cadf8f6986b76d3121c2fdaacd7a0c2104
7
- data.tar.gz: '0853ba7ad4d7725e0c1ab9f89e733e1ec361dee2abdbc835aace640216d7d0f3796afafd8e852f8b5a2d8cdae9d5347c064946c3eccfd9242065455602558796'
6
+ metadata.gz: c50b7bb1afb78e3c2e8577d11092879dfb0c748a131ba3cf164a05e1f41df81d1472a951f1b609eaced0162c85045221ff08813ae69d0ae713ef325e2aa11a46
7
+ data.tar.gz: 873270ee657aa2d0fe1f13153d2bf2c26e1ed5fbebb6815ca363f783f3550bbb30abad62922b115402a38231681af72211feaac937611e1773448a493f54003c
data/README.md CHANGED
@@ -40,11 +40,43 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
40
40
  </a>
41
41
  <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
42
42
  </td>
43
- <td id='jorge-revuelta-h'>
44
- <a href='https://github.com/minuscorp'>
45
- <img src='https://github.com/minuscorp.png?size=140'>
43
+ <td id='andrew-mcburney'>
44
+ <a href='https://github.com/armcburney'>
45
+ <img src='https://github.com/armcburney.png?size=140'>
46
46
  </a>
47
- <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
47
+ <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
48
+ </td>
49
+ <td id='fumiya-nakamura'>
50
+ <a href='https://github.com/nafu'>
51
+ <img src='https://github.com/nafu.png?size=140'>
52
+ </a>
53
+ <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
54
+ </td>
55
+ <td id='stefan-natchev'>
56
+ <a href='https://github.com/snatchev'>
57
+ <img src='https://github.com/snatchev.png?size=140'>
58
+ </a>
59
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
60
+ </td>
61
+ <td id='felix-krause'>
62
+ <a href='https://github.com/KrauseFx'>
63
+ <img src='https://github.com/KrauseFx.png?size=140'>
64
+ </a>
65
+ <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
66
+ </td>
67
+ </tr>
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>
48
80
  </td>
49
81
  <td id='jan-piotrowski'>
50
82
  <a href='https://github.com/janpio'>
@@ -52,31 +84,25 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
52
84
  </a>
53
85
  <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
54
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'>
90
+ </a>
91
+ <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
92
+ </td>
55
93
  <td id='jérôme-lacoste'>
56
94
  <a href='https://github.com/lacostej'>
57
95
  <img src='https://github.com/lacostej.png?size=140'>
58
96
  </a>
59
97
  <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
60
98
  </td>
61
- <td id='olivier-halligon'>
62
- <a href='https://github.com/AliSoftware'>
63
- <img src='https://github.com/AliSoftware.png?size=140'>
64
- </a>
65
- <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
66
- </td>
67
99
  </tr>
68
100
  <tr>
69
- <td id='aaron-brager'>
70
- <a href='https://github.com/getaaron'>
71
- <img src='https://github.com/getaaron.png?size=140'>
72
- </a>
73
- <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
74
- </td>
75
- <td id='fumiya-nakamura'>
76
- <a href='https://github.com/nafu'>
77
- <img src='https://github.com/nafu.png?size=140'>
101
+ <td id='daniel-jankowski'>
102
+ <a href='https://github.com/mollyIV'>
103
+ <img src='https://github.com/mollyIV.png?size=140'>
78
104
  </a>
79
- <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
105
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
80
106
  </td>
81
107
  <td id='joshua-liebowitz'>
82
108
  <a href='https://github.com/taquitos'>
@@ -84,11 +110,17 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
84
110
  </a>
85
111
  <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
86
112
  </td>
87
- <td id='helmut-januschka'>
88
- <a href='https://github.com/hjanuschka'>
89
- <img src='https://github.com/hjanuschka.png?size=140'>
113
+ <td id='danielle-tomlinson'>
114
+ <a href='https://github.com/endocrimes'>
115
+ <img src='https://github.com/endocrimes.png?size=140'>
90
116
  </a>
91
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
117
+ <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
118
+ </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'>
122
+ </a>
123
+ <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
92
124
  </td>
93
125
  <td id='luka-mirosevic'>
94
126
  <a href='https://github.com/lmirosevic'>
@@ -98,11 +130,17 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
98
130
  </td>
99
131
  </tr>
100
132
  <tr>
101
- <td id='max-ott'>
102
- <a href='https://github.com/max-ott'>
103
- <img src='https://github.com/max-ott.png?size=140'>
133
+ <td id='helmut-januschka'>
134
+ <a href='https://github.com/hjanuschka'>
135
+ <img src='https://github.com/hjanuschka.png?size=140'>
104
136
  </a>
105
- <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
137
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
138
+ </td>
139
+ <td id='olivier-halligon'>
140
+ <a href='https://github.com/AliSoftware'>
141
+ <img src='https://github.com/AliSoftware.png?size=140'>
142
+ </a>
143
+ <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
106
144
  </td>
107
145
  <td id='josh-holtz'>
108
146
  <a href='https://github.com/joshdholtz'>
@@ -110,69 +148,31 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
110
148
  </a>
111
149
  <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
112
150
  </td>
113
- <td id='maksym-grebenets'>
114
- <a href='https://github.com/mgrebenets'>
115
- <img src='https://github.com/mgrebenets.png?size=140'>
151
+ <td id='aaron-brager'>
152
+ <a href='https://github.com/getaaron'>
153
+ <img src='https://github.com/getaaron.png?size=140'>
116
154
  </a>
117
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
155
+ <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
118
156
  </td>
119
- <td id='jimmy-dee'>
120
- <a href='https://github.com/jdee'>
121
- <img src='https://github.com/jdee.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'>
122
160
  </a>
123
- <h4 align='center'>Jimmy Dee</h4>
161
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
124
162
  </td>
163
+ </tr>
164
+ <tr>
125
165
  <td id='manu-wallner'>
126
166
  <a href='https://github.com/milch'>
127
167
  <img src='https://github.com/milch.png?size=140'>
128
168
  </a>
129
169
  <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
130
170
  </td>
131
- </tr>
132
- <tr>
133
- <td id='felix-krause'>
134
- <a href='https://github.com/KrauseFx'>
135
- <img src='https://github.com/KrauseFx.png?size=140'>
136
- </a>
137
- <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</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'>
142
- </a>
143
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
144
- </td>
145
- <td id='iulian-onofrei'>
146
- <a href='https://github.com/revolter'>
147
- <img src='https://github.com/revolter.png?size=140'>
148
- </a>
149
- <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
150
- </td>
151
- <td id='daniel-jankowski'>
152
- <a href='https://github.com/mollyIV'>
153
- <img src='https://github.com/mollyIV.png?size=140'>
154
- </a>
155
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
156
- </td>
157
- <td id='stefan-natchev'>
158
- <a href='https://github.com/snatchev'>
159
- <img src='https://github.com/snatchev.png?size=140'>
160
- </a>
161
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
162
- </td>
163
- </tr>
164
- <tr>
165
- <td id='andrew-mcburney'>
166
- <a href='https://github.com/armcburney'>
167
- <img src='https://github.com/armcburney.png?size=140'>
168
- </a>
169
- <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
170
- </td>
171
- <td id='kohki-miki'>
172
- <a href='https://github.com/giginet'>
173
- <img src='https://github.com/giginet.png?size=140'>
171
+ <td id='maksym-grebenets'>
172
+ <a href='https://github.com/mgrebenets'>
173
+ <img src='https://github.com/mgrebenets.png?size=140'>
174
174
  </a>
175
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</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,7 +231,7 @@ 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
234
+ raw_data = Base64.decode64(certificate.certificate_content)
218
235
  File.write(path, raw_data)
219
236
  return path
220
237
  end