From 8fe3fd8e516730698c1d1aa322c934646dc4fcb9 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 31 Jul 2024 20:26:33 +1000 Subject: [PATCH] Add lanes for getting Developer ID as well as ASC certificates --- fastlane/Fastfile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 37a57b13..e63dda3e 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -395,7 +395,7 @@ lane :build_and_upload_app_store do |options| setup_ci - app_store_code_signing + configure_code_signing_release archive_path = File.join(BUILD_FOLDER, 'Simplenote-Mac.xcarchive') build_simplenote( @@ -499,13 +499,20 @@ lane :download_strings_files_from_glotpress do ) end -# Downloads all the required certificates and profiles for the production build. -# Optionally, it can create any new necessary certificates or profiles. -# -# @option [Boolean] readonly (default: true) Whether to only fetch existing certificates and profiles, without generating new ones. -lane :app_store_code_signing do |options| - # Fail early if secrets not available via `get_required_env`. - # Otherwise, Fastlane will prompt to type them. +lane :configure_code_signing do |readonly: true| + configure_code_signing_app_center(readonly: readonly) + configure_code_signing_app_store(readonly: readonly) +end + +lane :configure_code_signing_app_center do |readonly: true| + configure_code_signing(type: 'developer_id', readonly: readonly) +end + +lane :configure_code_signing_app_store do |readonly: true| + configure_code_signing(type: 'appstore', readonly: readonly) +end + +def configure_code_signing(type:, readonly: true) access_key = get_required_env('MATCH_S3_ACCESS_KEY') secret_access_key = get_required_env('MATCH_S3_SECRET_ACCESS_KEY') @@ -516,11 +523,9 @@ lane :app_store_code_signing do |options| s3_access_key: access_key, s3_secret_access_key: secret_access_key, team_id: APPLE_TEAM_ID, - type: 'appstore', + type: type, platform: 'macos', - # This Mac app also needs a Mac Installer Distribution certificate - additional_cert_types: 'mac_installer_distribution', - readonly: options.fetch(:readonly, true), + readonly: readonly, app_identifier: [ APP_STORE_BUNDLE_IDENTIFIER, APP_STORE_BUNDLE_IDENTIFIER_INTENTS