1212
1313default_platform ( :ios )
1414
15- TEAMID = ENV [ "TEAMID_SUFFIX" ] . to_s . empty? ? "#{ ENV [ "TEAMID" ] } " : "#{ ENV [ "TEAMID" ] } -#{ ENV [ "TEAMID_SUFFIX" ] } "
15+ TEAMID = ENV [ "TEAMID" ]
16+ TEAMID_SUFFIX = ENV [ "TEAMID_SUFFIX" ] . to_s . empty? ? "" : "-#{ ENV [ "TEAMID_SUFFIX" ] } "
1617GH_PAT = ENV [ "GH_PAT" ]
1718GITHUB_WORKSPACE = ENV [ "GITHUB_WORKSPACE" ]
1819GITHUB_REPOSITORY_OWNER = ENV [ "GITHUB_REPOSITORY_OWNER" ]
@@ -40,7 +41,7 @@ platform :ios do
4041 )
4142
4243 previous_build_number = latest_testflight_build_number (
43- app_identifier : "com.#{ TEAMID } .loopkit.Loop" ,
44+ app_identifier : "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop" ,
4445 api_key : api_key ,
4546 )
4647
@@ -51,16 +52,17 @@ platform :ios do
5152 build_number : current_build_number
5253 )
5354
55+ UI . message ( "Using app identifiers with TEAMID=#{ TEAMID } SUFFIX=#{ TEAMID_SUFFIX } " )
5456 match (
5557 type : "appstore" ,
5658 git_basic_authorization : Base64 . strict_encode64 ( "#{ GITHUB_REPOSITORY_OWNER } :#{ GH_PAT } " ) ,
5759 app_identifier : [
58- "com.#{ TEAMID } .loopkit.Loop" ,
59- "com.#{ TEAMID } .loopkit.Loop.statuswidget" ,
60- "com.#{ TEAMID } .loopkit.Loop.LoopWatch.watchkitextension" ,
61- "com.#{ TEAMID } .loopkit.Loop.LoopWatch" ,
62- "com.#{ TEAMID } .loopkit.Loop.Loop-Intent-Extension" ,
63- "com.#{ TEAMID } .loopkit.Loop.LoopWidgetExtension"
60+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop" ,
61+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.statuswidget" ,
62+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch.watchkitextension" ,
63+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch" ,
64+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.Loop-Intent-Extension" ,
65+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWidgetExtension"
6466 ]
6567 )
6668
@@ -70,7 +72,7 @@ platform :ios do
7072
7173 update_code_signing_settings (
7274 path : "#{ GITHUB_WORKSPACE } /Loop/Loop.xcodeproj" ,
73- profile_name : mapping [ "com.#{ TEAMID } .loopkit.Loop" ] ,
75+ profile_name : mapping [ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop" ] ,
7476 code_sign_identity : "iPhone Distribution" ,
7577 targets : [ "Loop" ]
7678 )
@@ -83,35 +85,35 @@ platform :ios do
8385
8486 update_code_signing_settings (
8587 path : "#{ GITHUB_WORKSPACE } /Loop/Loop.xcodeproj" ,
86- profile_name : mapping [ "com.#{ TEAMID } .loopkit.Loop.statuswidget" ] ,
88+ profile_name : mapping [ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.statuswidget" ] ,
8789 code_sign_identity : "iPhone Distribution" ,
8890 targets : [ "Loop Status Extension" ]
8991 )
9092
9193 update_code_signing_settings (
9294 path : "#{ GITHUB_WORKSPACE } /Loop/Loop.xcodeproj" ,
93- profile_name : mapping [ "com.#{ TEAMID } .loopkit.Loop.LoopWatch.watchkitextension" ] ,
95+ profile_name : mapping [ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch.watchkitextension" ] ,
9496 code_sign_identity : "iPhone Distribution" ,
9597 targets : [ "WatchApp Extension" ]
9698 )
9799
98100 update_code_signing_settings (
99101 path : "#{ GITHUB_WORKSPACE } /Loop/Loop.xcodeproj" ,
100- profile_name : mapping [ "com.#{ TEAMID } .loopkit.Loop.LoopWatch" ] ,
102+ profile_name : mapping [ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch" ] ,
101103 code_sign_identity : "iPhone Distribution" ,
102104 targets : [ "WatchApp" ]
103105 )
104106
105107 update_code_signing_settings (
106108 path : "#{ GITHUB_WORKSPACE } /Loop/Loop.xcodeproj" ,
107- profile_name : mapping [ "com.#{ TEAMID } .loopkit.Loop.Loop-Intent-Extension" ] ,
109+ profile_name : mapping [ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.Loop-Intent-Extension" ] ,
108110 code_sign_identity : "iPhone Distribution" ,
109111 targets : [ "Loop Intent Extension" ]
110112 )
111113
112114 update_code_signing_settings (
113115 path : "#{ GITHUB_WORKSPACE } /Loop/Loop.xcodeproj" ,
114- profile_name : mapping [ "com.#{ TEAMID } .loopkit.Loop.LoopWidgetExtension" ] ,
116+ profile_name : mapping [ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWidgetExtension" ] ,
115117 code_sign_identity : "iPhone Distribution" ,
116118 targets : [ "Loop Widget Extension" ]
117119 )
@@ -122,8 +124,8 @@ platform :ios do
122124 output_name : "Loop.ipa" ,
123125 configuration : "Release" ,
124126 destination : 'generic/platform=iOS' ,
125- buildlog_path : 'buildlog'
126- xcargs : "MAIN_APP_BUNDLE_IDENTIFIER=com.#{ TEAMID } .loopkit.Loop"
127+ buildlog_path : 'buildlog' ,
128+ xcargs : "MAIN_APP_BUNDLE_IDENTIFIER=com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop"
127129 )
128130
129131 copy_artifacts (
@@ -171,30 +173,30 @@ platform :ios do
171173 end
172174 end
173175
174- configure_bundle_id ( "Loop" , "com.#{ TEAMID } .loopkit.Loop" , [
176+ configure_bundle_id ( "Loop" , "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop" , [
175177 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::APP_GROUPS ,
176178 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::HEALTHKIT ,
177179 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::PUSH_NOTIFICATIONS ,
178180 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::SIRIKIT ,
179181 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::NFC_TAG_READING
180182 ] )
181183
182- configure_bundle_id ( "Loop Intent Extension" , "com.#{ TEAMID } .loopkit.Loop.Loop-Intent-Extension" , [
184+ configure_bundle_id ( "Loop Intent Extension" , "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.Loop-Intent-Extension" , [
183185 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::APP_GROUPS
184186 ] )
185187
186- configure_bundle_id ( "Loop Status Extension" , "com.#{ TEAMID } .loopkit.Loop.statuswidget" , [
188+ configure_bundle_id ( "Loop Status Extension" , "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.statuswidget" , [
187189 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::APP_GROUPS
188190 ] )
189191
190- configure_bundle_id ( "WatchApp" , "com.#{ TEAMID } .loopkit.Loop.LoopWatch" , [ ] )
192+ configure_bundle_id ( "WatchApp" , "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch" , [ ] )
191193
192- configure_bundle_id ( "WatchApp Extension" , "com.#{ TEAMID } .loopkit.Loop.LoopWatch.watchkitextension" , [
194+ configure_bundle_id ( "WatchApp Extension" , "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch.watchkitextension" , [
193195 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::HEALTHKIT ,
194196 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::SIRIKIT
195197 ] )
196198
197- configure_bundle_id ( "Loop Widget Extension" , "com.#{ TEAMID } .loopkit.Loop.LoopWidgetExtension" , [
199+ configure_bundle_id ( "Loop Widget Extension" , "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWidgetExtension" , [
198200 Spaceship ::ConnectAPI ::BundleIdCapability ::Type ::APP_GROUPS
199201 ] )
200202
@@ -217,12 +219,12 @@ platform :ios do
217219 verbose : true ,
218220 git_basic_authorization : Base64 . strict_encode64 ( "#{ GITHUB_REPOSITORY_OWNER } :#{ GH_PAT } " ) ,
219221 app_identifier : [
220- "com.#{ TEAMID } .loopkit.Loop" ,
221- "com.#{ TEAMID } .loopkit.Loop.statuswidget" ,
222- "com.#{ TEAMID } .loopkit.Loop.LoopWatch.watchkitextension" ,
223- "com.#{ TEAMID } .loopkit.Loop.LoopWatch" ,
224- "com.#{ TEAMID } .loopkit.Loop.Loop-Intent-Extension" ,
225- "com.#{ TEAMID } .loopkit.Loop.LoopWidgetExtension" ,
222+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop" ,
223+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.statuswidget" ,
224+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch.watchkitextension" ,
225+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWatch" ,
226+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.Loop-Intent-Extension" ,
227+ "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop.LoopWidgetExtension" ,
226228 ]
227229 )
228230 end
@@ -242,7 +244,7 @@ platform :ios do
242244 bundle_id = Spaceship ::ConnectAPI ::BundleId . find ( identifier )
243245 end
244246
245- find_bundle_id ( "com.#{ TEAMID } .loopkit.Loop" )
247+ find_bundle_id ( "com.#{ TEAMID } #{ TEAMID_SUFFIX } .loopkit.Loop" )
246248
247249 match (
248250 type : "appstore" ,
@@ -265,7 +267,7 @@ platform :ios do
265267
266268 match_nuke (
267269 type : "appstore" ,
268- team_id : "#{ TEAMID } " ,
270+ team_id : "#{ TEAMID } #{ TEAMID_SUFFIX } " ,
269271 skip_confirmation : true ,
270272 git_basic_authorization : Base64 . strict_encode64 ( "#{ GITHUB_REPOSITORY_OWNER } :#{ GH_PAT } " )
271273 )
@@ -322,4 +324,4 @@ platform :ios do
322324 new_certificate_needed_content = File . read ( file_path )
323325 puts "Certificate creation or renewal needed: #{ new_certificate_needed_content } "
324326 end
325- end
327+ end
0 commit comments