11XCODE_PROJ = "DevLog.xcodeproj"
22APP_IDENTIFIER = "opfic.DevLog"
3+ WIDGET_IDENTIFIER = "opfic.DevLog.DevLogWidget"
4+ APP_IDENTIFIERS = [ APP_IDENTIFIER , WIDGET_IDENTIFIER ]
35TARGET_NAME = "DevLog"
6+ WIDGET_TARGET_NAME = "DevLogWidgetExtension"
47TESTFLIGHT_BUILD_OUTPUT_DIRECTORY = File . expand_path ( "testflight_build" , __dir__ )
58TESTFLIGHT_IPA_OUTPUT_PATH = File . join ( TESTFLIGHT_BUILD_OUTPUT_DIRECTORY , "#{ TARGET_NAME } .ipa" )
69
@@ -76,23 +79,32 @@ platform :ios do
7679 match (
7780 api_key : api_key ,
7881 type : "appstore" ,
82+ app_identifier : APP_IDENTIFIERS ,
7983 readonly : ENV [ "CI" ] == "true"
8084 )
8185
8286 if ENV [ "CI" ] == "true"
83- provisioning_profile_specifier = lane_context [ SharedValues ::MATCH_PROVISIONING_PROFILE_MAPPING ] [ APP_IDENTIFIER ] . to_s
84- UI . user_error! ( "Missing App Store provisioning profile mapping for #{ APP_IDENTIFIER } " ) if provisioning_profile_specifier . empty?
85-
86- update_code_signing_settings (
87- use_automatic_signing : false ,
88- path : XCODE_PROJ ,
89- sdk : "iphoneos*" ,
90- team_id : ENV [ "APP_STORE_TEAM_ID" ] ,
91- targets : [ TARGET_NAME ] ,
92- build_configurations : [ "Release" ] ,
93- code_sign_identity : "Apple Distribution" ,
94- profile_name : provisioning_profile_specifier
95- )
87+ profile_mapping = lane_context [ SharedValues ::MATCH_PROVISIONING_PROFILE_MAPPING ]
88+ signing_targets = {
89+ TARGET_NAME => APP_IDENTIFIER ,
90+ WIDGET_TARGET_NAME => WIDGET_IDENTIFIER
91+ }
92+
93+ signing_targets . each do |target_name , app_identifier |
94+ provisioning_profile_specifier = profile_mapping [ app_identifier ] . to_s
95+ UI . user_error! ( "Missing App Store provisioning profile mapping for #{ app_identifier } " ) if provisioning_profile_specifier . empty?
96+
97+ update_code_signing_settings (
98+ use_automatic_signing : false ,
99+ path : XCODE_PROJ ,
100+ sdk : "iphoneos*" ,
101+ team_id : ENV [ "APP_STORE_TEAM_ID" ] ,
102+ targets : [ target_name ] ,
103+ build_configurations : [ "Release" ] ,
104+ code_sign_identity : "Apple Distribution" ,
105+ profile_name : provisioning_profile_specifier
106+ )
107+ end
96108 end
97109
98110 build_app (
@@ -117,6 +129,19 @@ platform :ios do
117129 build_for_store
118130 end
119131
132+ lane :sync_appstore_profiles do
133+ api_key = asc_api_key
134+ match_force = ENV . fetch ( "MATCH_FORCE" , "false" ) == "true"
135+
136+ match (
137+ api_key : api_key ,
138+ type : "appstore" ,
139+ app_identifier : APP_IDENTIFIERS ,
140+ force : match_force ,
141+ readonly : false
142+ )
143+ end
144+
120145 lane :upload_testflight_build do
121146 api_key = asc_api_key
122147 # lane_context는 같은 fastlane 실행 내에서만 유지되므로, 별도 CI step에서는 고정 ipa 경로를 사용한다.
0 commit comments