You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fastlane/Fastfile
+45-28Lines changed: 45 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -618,13 +618,7 @@ platform :ios do
618
618
# We're about to use `add_development_certificates_to_provisioning_profiles` and `add_all_devices_to_provisioning_profiles`.
619
619
# These actions use Developer Portal APIs that don't yet support authentication via API key (-.-').
620
620
# Let's preemptively ask for and set the email here to avoid being asked twice for it if not set.
621
-
622
-
require'credentials_manager'
623
-
624
-
# If Fastlane cannot instantiate a user, it will ask the caller for the email.
625
-
# Once we have it, we can set it as `FASTLANE_USER` in the environment (which has lifecycle limited to this call) so that the next commands will already have access to it.
626
-
# Note that if the user is already available to `AccountManager`, setting it in the environment is redundant, but Fastlane doesn't provide a way to check it so we have to do it anyway.
# Downloads all the required certificates and profiles the enterprise build.
938
+
# Optionally, it can create any new necessary certificate or profile.
939
+
#
940
+
# @option [Boolean] readonly (default: true) Whether to only fetch existing certificates and profiles, without generating new ones.
941
+
private_lane:alpha_code_signingdo |options|
942
+
readonly=options.fetch(:readonly,true)
943
+
944
+
ifreadonly
945
+
# In readonly mode, we can use the API key
946
+
api_key_path=ASC_KEY_PATH
947
+
else
948
+
# The Enterprise account APIs do not support authentication via API key.
949
+
# If we want to modify data (readonly = false) we need to authenticate manually.
950
+
prompt_user_for_app_store_connect_credentials
951
+
# We also need to pass no API key path, otherwise Fastlane will give
952
+
# precedence to that authentication mode.
953
+
api_key_path=nil
954
+
end
955
+
954
956
match(
955
957
type: 'enterprise',
956
958
team_id: get_required_env('INT_EXPORT_TEAM_ID'),
957
959
app_identifier: ALPHA_BUNDLE_IDENTIFIERS,
958
-
readonly: true
960
+
readonly: readonly,
961
+
api_key_path: api_key_path
959
962
)
960
963
end
961
964
962
-
private_lane:appstore_code_signingdo
965
+
# Downloads all the required certificates and profiles the production build.
966
+
# Optionally, it can create any new necessary certificate or profile.
967
+
#
968
+
# @option [Boolean] readonly (default: true) Whether to only fetch existing certificates and profiles, without generating new ones.
969
+
private_lane:appstore_code_signingdo |options|
963
970
match(
964
971
type: 'appstore',
965
972
team_id: get_required_env('EXT_EXPORT_TEAM_ID'),
966
973
app_identifier: MAIN_BUNDLE_IDENTIFIERS,
967
-
readonly: true
974
+
readonly: options.fetch(:readonly,true),
975
+
api_key_path: ASC_KEY_PATH
968
976
)
969
977
end
970
978
@@ -1172,6 +1180,15 @@ def buildkite_ci?
1172
1180
ENV.fetch('BUILDKITE',false)
1173
1181
end
1174
1182
1183
+
defprompt_user_for_app_store_connect_credentials
1184
+
require'credentials_manager'
1185
+
1186
+
# If Fastlane cannot instantiate a user, it will ask the caller for the email.
1187
+
# Once we have it, we can set it as `FASTLANE_USER` in the environment (which has lifecycle limited to this call) so that the next commands will already have access to it.
1188
+
# Note that if the user is already available to `AccountManager`, setting it in the environment is redundant, but Fastlane doesn't provide a way to check it so we have to do it anyway.
0 commit comments