diff --git a/.github/workflows/add_identifiers.yml b/.github/workflows/add_identifiers.yml index 6661ba30c9..a252ec5d5e 100644 --- a/.github/workflows/add_identifiers.yml +++ b/.github/workflows/add_identifiers.yml @@ -42,6 +42,7 @@ jobs: run: bundle exec fastlane identifiers env: TEAMID: ${{ secrets.TEAMID }} + TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }} GH_PAT: ${{ secrets.GH_PAT }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index db33b8991b..fbae702817 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -235,6 +235,7 @@ jobs: run: bundle exec fastlane build_loop env: TEAMID: ${{ secrets.TEAMID }} + TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }} GH_PAT: ${{ secrets.GH_PAT }} FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} @@ -246,6 +247,7 @@ jobs: run: bundle exec fastlane release env: TEAMID: ${{ secrets.TEAMID }} + TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }} GH_PAT: ${{ secrets.GH_PAT }} FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} diff --git a/.github/workflows/create_certs.yml b/.github/workflows/create_certs.yml index d20001b2ca..2bca6648a1 100644 --- a/.github/workflows/create_certs.yml +++ b/.github/workflows/create_certs.yml @@ -5,6 +5,7 @@ on: [workflow_call, workflow_dispatch] env: TEAMID: ${{ secrets.TEAMID }} + TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }} GH_PAT: ${{ secrets.GH_PAT }} GH_TOKEN: ${{ secrets.GH_PAT }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} diff --git a/.github/workflows/validate_secrets.yml b/.github/workflows/validate_secrets.yml index f8d97c4f48..45045b2ced 100644 --- a/.github/workflows/validate_secrets.yml +++ b/.github/workflows/validate_secrets.yml @@ -114,6 +114,7 @@ jobs: FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} TEAMID: ${{ secrets.TEAMID }} + TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }} steps: - name: Checkout Repo uses: actions/checkout@v4 diff --git a/LoopConfigOverride.xcconfig b/LoopConfigOverride.xcconfig index 2969db2882..a685cb48b2 100644 --- a/LoopConfigOverride.xcconfig +++ b/LoopConfigOverride.xcconfig @@ -1,7 +1,7 @@ #include? "../../LoopConfigOverride.xcconfig" // Override this if you don't want the default com.${DEVELOPMENT_TEAM}.loopkit that loop uses -// MAIN_APP_BUNDLE_IDENTIFIER = com.myname.loop +//MAIN_APP_BUNDLE_IDENTIFIER = com.${TEAMID}.${TEAMID_SUFFIX}.loopkit // Customize this to change the app name displayed //MAIN_APP_DISPLAY_NAME = Loop diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 3e16b5bd9e..4ceb883e5a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -22,6 +22,8 @@ FASTLANE_KEY = ENV["FASTLANE_KEY"] DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" +TEAMID_SUFFIX = ENV["TEAMID_SUFFIX"].to_s.empty? ? "" : ".#{ENV["TEAMID_SUFFIX"]}" + platform :ios do desc "Build Loop" @@ -40,7 +42,7 @@ platform :ios do ) previous_build_number = latest_testflight_build_number( - app_identifier: "com.#{TEAMID}.loopkit.Loop", + app_identifier: "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop", api_key: api_key, ) @@ -55,12 +57,12 @@ platform :ios do type: "appstore", git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: [ - "com.#{TEAMID}.loopkit.Loop", - "com.#{TEAMID}.loopkit.Loop.statuswidget", - "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", - "com.#{TEAMID}.loopkit.Loop.LoopWatch", - "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension", - "com.#{TEAMID}.loopkit.Loop.LoopWidgetExtension" + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.statuswidget", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch.watchkitextension", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.Loop-Intent-Extension", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWidgetExtension" ] ) @@ -70,7 +72,7 @@ platform :ios do update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", - profile_name: mapping["com.#{TEAMID}.loopkit.Loop"], + profile_name: mapping["com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop"], code_sign_identity: "iPhone Distribution", targets: ["Loop"] ) @@ -83,35 +85,35 @@ platform :ios do update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", - profile_name: mapping["com.#{TEAMID}.loopkit.Loop.statuswidget"], + profile_name: mapping["com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.statuswidget"], code_sign_identity: "iPhone Distribution", targets: ["Loop Status Extension"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", - profile_name: mapping["com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension"], + profile_name: mapping["com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch.watchkitextension"], code_sign_identity: "iPhone Distribution", targets: ["WatchApp Extension"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", - profile_name: mapping["com.#{TEAMID}.loopkit.Loop.LoopWatch"], + profile_name: mapping["com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch"], code_sign_identity: "iPhone Distribution", targets: ["WatchApp"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", - profile_name: mapping["com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"], + profile_name: mapping["com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.Loop-Intent-Extension"], code_sign_identity: "iPhone Distribution", targets: ["Loop Intent Extension"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", - profile_name: mapping["com.#{TEAMID}.loopkit.Loop.LoopWidgetExtension"], + profile_name: mapping["com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWidgetExtension"], code_sign_identity: "iPhone Distribution", targets: ["Loop Widget Extension"] ) @@ -170,7 +172,7 @@ platform :ios do end end - configure_bundle_id("Loop", "com.#{TEAMID}.loopkit.Loop", [ + configure_bundle_id("Loop", "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop", [ Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS, Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT, Spaceship::ConnectAPI::BundleIdCapability::Type::PUSH_NOTIFICATIONS, @@ -178,22 +180,22 @@ platform :ios do Spaceship::ConnectAPI::BundleIdCapability::Type::NFC_TAG_READING ]) - configure_bundle_id("Loop Intent Extension", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension", [ + configure_bundle_id("Loop Intent Extension", "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.Loop-Intent-Extension", [ Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS ]) - configure_bundle_id("Loop Status Extension", "com.#{TEAMID}.loopkit.Loop.statuswidget", [ + configure_bundle_id("Loop Status Extension", "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.statuswidget", [ Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS ]) - configure_bundle_id("WatchApp", "com.#{TEAMID}.loopkit.Loop.LoopWatch", []) + configure_bundle_id("WatchApp", "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch", []) - configure_bundle_id("WatchApp Extension", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", [ + configure_bundle_id("WatchApp Extension", "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch.watchkitextension", [ Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT, Spaceship::ConnectAPI::BundleIdCapability::Type::SIRIKIT ]) - configure_bundle_id("Loop Widget Extension", "com.#{TEAMID}.loopkit.Loop.LoopWidgetExtension", [ + configure_bundle_id("Loop Widget Extension", "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWidgetExtension", [ Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS ]) @@ -216,12 +218,12 @@ platform :ios do verbose: true, git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: [ - "com.#{TEAMID}.loopkit.Loop", - "com.#{TEAMID}.loopkit.Loop.statuswidget", - "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", - "com.#{TEAMID}.loopkit.Loop.LoopWatch", - "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension", - "com.#{TEAMID}.loopkit.Loop.LoopWidgetExtension", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.statuswidget", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch.watchkitextension", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWatch", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.Loop-Intent-Extension", + "com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop.LoopWidgetExtension", ] ) end @@ -241,7 +243,7 @@ platform :ios do bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier) end - find_bundle_id("com.#{TEAMID}.loopkit.Loop") + find_bundle_id("com.#{TEAMID}#{TEAMID_SUFFIX}.loopkit.Loop") match( type: "appstore", @@ -321,4 +323,4 @@ platform :ios do new_certificate_needed_content = File.read(file_path) puts "Certificate creation or renewal needed: #{new_certificate_needed_content}" end -end \ No newline at end of file +end