fastlane 2.161.0 → 2.162.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +76 -76
- data/cert/lib/cert/options.rb +28 -1
- data/cert/lib/cert/runner.rb +50 -33
- data/deliver/lib/deliver/app_screenshot_iterator.rb +4 -4
- data/deliver/lib/deliver/options.rb +2 -2
- data/deliver/lib/deliver/upload_metadata.rb +1 -0
- data/deliver/lib/deliver/upload_screenshots.rb +25 -8
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +1 -1
- data/fastlane/swift/Fastlane.swift +51 -3
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +15 -3
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +1 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
- data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +6 -7
- data/fastlane_core/lib/fastlane_core/keychain_importer.rb +2 -2
- data/match/lib/match/generator.rb +6 -1
- data/match/lib/match/importer.rb +39 -6
- data/match/lib/match/migrate.rb +13 -2
- data/match/lib/match/nuke.rb +65 -22
- data/match/lib/match/options.rb +26 -1
- data/match/lib/match/runner.rb +38 -10
- data/match/lib/match/spaceship_ensure.rb +27 -21
- data/match/lib/match/storage/google_cloud_storage.rb +20 -3
- data/match/lib/match/storage/s3_storage.rb +19 -3
- data/sigh/lib/sigh/options.rb +21 -0
- data/sigh/lib/sigh/runner.rb +80 -38
- data/spaceship/lib/spaceship/client.rb +2 -1
- data/spaceship/lib/spaceship/connect_api.rb +1 -0
- data/spaceship/lib/spaceship/connect_api/api_client.rb +3 -3
- data/spaceship/lib/spaceship/connect_api/client.rb +13 -3
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +3 -1
- data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +2 -1
- data/spaceship/lib/spaceship/connect_api/models/certificate.rb +42 -0
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +7 -1
- data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +59 -0
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +28 -2
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
- data/spaceship/lib/spaceship/connect_api/users/users.rb +40 -0
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfbc3b8babe2db6398b23a113db895f79eea46daa635909a2146e2df6ab4fa2d
|
4
|
+
data.tar.gz: d643dd677d37e514523433380eb65dc67798ec67cb9c4726c33e84529156b337
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c50b7bb1afb78e3c2e8577d11092879dfb0c748a131ba3cf164a05e1f41df81d1472a951f1b609eaced0162c85045221ff08813ae69d0ae713ef325e2aa11a46
|
7
|
+
data.tar.gz: 873270ee657aa2d0fe1f13153d2bf2c26e1ed5fbebb6815ca363f783f3550bbb30abad62922b115402a38231681af72211feaac937611e1773448a493f54003c
|
data/README.md
CHANGED
@@ -34,23 +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='
|
38
|
-
<a href='https://github.com/
|
39
|
-
<img src='https://github.com/
|
40
|
-
</a>
|
41
|
-
<h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
|
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'>
|
37
|
+
<td id='matthew-ellis'>
|
38
|
+
<a href='https://github.com/matthewellis'>
|
39
|
+
<img src='https://github.com/matthewellis.png?size=140'>
|
46
40
|
</a>
|
47
|
-
<h4 align='center'><a href='https://twitter.com/
|
41
|
+
<h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
|
48
42
|
</td>
|
49
|
-
<td id='
|
50
|
-
<a href='https://github.com/
|
51
|
-
<img src='https://github.com/
|
43
|
+
<td id='andrew-mcburney'>
|
44
|
+
<a href='https://github.com/armcburney'>
|
45
|
+
<img src='https://github.com/armcburney.png?size=140'>
|
52
46
|
</a>
|
53
|
-
<h4 align='center'><a href='https://twitter.com/
|
47
|
+
<h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
|
54
48
|
</td>
|
55
49
|
<td id='fumiya-nakamura'>
|
56
50
|
<a href='https://github.com/nafu'>
|
@@ -58,25 +52,11 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
|
|
58
52
|
</a>
|
59
53
|
<h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
|
60
54
|
</td>
|
61
|
-
<td id='
|
62
|
-
<a href='https://github.com/
|
63
|
-
<img src='https://github.com/
|
64
|
-
</a>
|
65
|
-
<h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
|
66
|
-
</td>
|
67
|
-
</tr>
|
68
|
-
<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='max-ott'>
|
76
|
-
<a href='https://github.com/max-ott'>
|
77
|
-
<img src='https://github.com/max-ott.png?size=140'>
|
55
|
+
<td id='stefan-natchev'>
|
56
|
+
<a href='https://github.com/snatchev'>
|
57
|
+
<img src='https://github.com/snatchev.png?size=140'>
|
78
58
|
</a>
|
79
|
-
<h4 align='center'><a href='https://twitter.com/
|
59
|
+
<h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
|
80
60
|
</td>
|
81
61
|
<td id='felix-krause'>
|
82
62
|
<a href='https://github.com/KrauseFx'>
|
@@ -84,18 +64,6 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
|
|
84
64
|
</a>
|
85
65
|
<h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
|
86
66
|
</td>
|
87
|
-
<td id='luka-mirosevic'>
|
88
|
-
<a href='https://github.com/lmirosevic'>
|
89
|
-
<img src='https://github.com/lmirosevic.png?size=140'>
|
90
|
-
</a>
|
91
|
-
<h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
|
92
|
-
</td>
|
93
|
-
<td id='manu-wallner'>
|
94
|
-
<a href='https://github.com/milch'>
|
95
|
-
<img src='https://github.com/milch.png?size=140'>
|
96
|
-
</a>
|
97
|
-
<h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
|
98
|
-
</td>
|
99
67
|
</tr>
|
100
68
|
<tr>
|
101
69
|
<td id='iulian-onofrei'>
|
@@ -110,31 +78,37 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
|
|
110
78
|
</a>
|
111
79
|
<h4 align='center'>Jimmy Dee</h4>
|
112
80
|
</td>
|
113
|
-
<td id='
|
114
|
-
<a href='https://github.com/
|
115
|
-
<img src='https://github.com/
|
81
|
+
<td id='jan-piotrowski'>
|
82
|
+
<a href='https://github.com/janpio'>
|
83
|
+
<img src='https://github.com/janpio.png?size=140'>
|
116
84
|
</a>
|
117
|
-
<h4 align='center'><a href='https://twitter.com/
|
85
|
+
<h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
|
118
86
|
</td>
|
119
|
-
<td id='
|
120
|
-
<a href='https://github.com/
|
121
|
-
<img src='https://github.com/
|
87
|
+
<td id='jorge-revuelta-h'>
|
88
|
+
<a href='https://github.com/minuscorp'>
|
89
|
+
<img src='https://github.com/minuscorp.png?size=140'>
|
122
90
|
</a>
|
123
|
-
<h4 align='center'><a href='https://twitter.com/
|
91
|
+
<h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
|
124
92
|
</td>
|
125
|
-
<td id='
|
126
|
-
<a href='https://github.com/
|
127
|
-
<img src='https://github.com/
|
93
|
+
<td id='jérôme-lacoste'>
|
94
|
+
<a href='https://github.com/lacostej'>
|
95
|
+
<img src='https://github.com/lacostej.png?size=140'>
|
128
96
|
</a>
|
129
|
-
<h4 align='center'><a href='https://twitter.com/
|
97
|
+
<h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
|
130
98
|
</td>
|
131
99
|
</tr>
|
132
100
|
<tr>
|
133
|
-
<td id='
|
134
|
-
<a href='https://github.com/
|
135
|
-
<img src='https://github.com/
|
101
|
+
<td id='daniel-jankowski'>
|
102
|
+
<a href='https://github.com/mollyIV'>
|
103
|
+
<img src='https://github.com/mollyIV.png?size=140'>
|
136
104
|
</a>
|
137
|
-
<h4 align='center'><a href='https://twitter.com/
|
105
|
+
<h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
|
106
|
+
</td>
|
107
|
+
<td id='joshua-liebowitz'>
|
108
|
+
<a href='https://github.com/taquitos'>
|
109
|
+
<img src='https://github.com/taquitos.png?size=140'>
|
110
|
+
</a>
|
111
|
+
<h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
|
138
112
|
</td>
|
139
113
|
<td id='danielle-tomlinson'>
|
140
114
|
<a href='https://github.com/endocrimes'>
|
@@ -142,37 +116,63 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
|
|
142
116
|
</a>
|
143
117
|
<h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
|
144
118
|
</td>
|
145
|
-
<td id='
|
146
|
-
<a href='https://github.com/
|
147
|
-
<img src='https://github.com/
|
119
|
+
<td id='max-ott'>
|
120
|
+
<a href='https://github.com/max-ott'>
|
121
|
+
<img src='https://github.com/max-ott.png?size=140'>
|
148
122
|
</a>
|
149
|
-
<h4 align='center'><a href='https://twitter.com/
|
123
|
+
<h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
|
150
124
|
</td>
|
125
|
+
<td id='luka-mirosevic'>
|
126
|
+
<a href='https://github.com/lmirosevic'>
|
127
|
+
<img src='https://github.com/lmirosevic.png?size=140'>
|
128
|
+
</a>
|
129
|
+
<h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
|
130
|
+
</td>
|
131
|
+
</tr>
|
132
|
+
<tr>
|
151
133
|
<td id='helmut-januschka'>
|
152
134
|
<a href='https://github.com/hjanuschka'>
|
153
135
|
<img src='https://github.com/hjanuschka.png?size=140'>
|
154
136
|
</a>
|
155
137
|
<h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
|
156
138
|
</td>
|
157
|
-
<td id='
|
158
|
-
<a href='https://github.com/
|
159
|
-
<img src='https://github.com/
|
139
|
+
<td id='olivier-halligon'>
|
140
|
+
<a href='https://github.com/AliSoftware'>
|
141
|
+
<img src='https://github.com/AliSoftware.png?size=140'>
|
160
142
|
</a>
|
161
|
-
<h4 align='center'><a href='https://twitter.com/
|
143
|
+
<h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
|
144
|
+
</td>
|
145
|
+
<td id='josh-holtz'>
|
146
|
+
<a href='https://github.com/joshdholtz'>
|
147
|
+
<img src='https://github.com/joshdholtz.png?size=140'>
|
148
|
+
</a>
|
149
|
+
<h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
|
150
|
+
</td>
|
151
|
+
<td id='aaron-brager'>
|
152
|
+
<a href='https://github.com/getaaron'>
|
153
|
+
<img src='https://github.com/getaaron.png?size=140'>
|
154
|
+
</a>
|
155
|
+
<h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
|
156
|
+
</td>
|
157
|
+
<td id='kohki-miki'>
|
158
|
+
<a href='https://github.com/giginet'>
|
159
|
+
<img src='https://github.com/giginet.png?size=140'>
|
160
|
+
</a>
|
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='
|
166
|
-
<a href='https://github.com/
|
167
|
-
<img src='https://github.com/
|
165
|
+
<td id='manu-wallner'>
|
166
|
+
<a href='https://github.com/milch'>
|
167
|
+
<img src='https://github.com/milch.png?size=140'>
|
168
168
|
</a>
|
169
|
-
<h4 align='center'><a href='https://twitter.com/
|
169
|
+
<h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
|
170
170
|
</td>
|
171
|
-
<td id='
|
172
|
-
<a href='https://github.com/
|
173
|
-
<img src='https://github.com/
|
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/
|
175
|
+
<h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
|
176
176
|
</td>
|
177
177
|
</table>
|
178
178
|
|
data/cert/lib/cert/options.rb
CHANGED
@@ -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)",
|
data/cert/lib/cert/runner.rb
CHANGED
@@ -20,10 +20,20 @@ module Cert
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def login
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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.
|
69
|
-
certificate.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
-
|
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
|
151
|
+
return Spaceship::ConnectAPI::Certificate::CertificateType::MAC_INSTALLER_DISTRIBUTION
|
141
152
|
when :developer_id_application
|
142
|
-
return Spaceship
|
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
|
-
|
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
|
153
|
-
cert_type = Spaceship
|
154
|
-
cert_type = Spaceship
|
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
|
159
|
-
cert_type = Spaceship
|
160
|
-
cert_type = Spaceship
|
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
|
164
|
-
cert_type = Spaceship
|
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.
|
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 =
|
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.
|
234
|
+
raw_data = Base64.decode64(certificate.certificate_content)
|
218
235
|
File.write(path, raw_data)
|
219
236
|
return path
|
220
237
|
end
|