Skip to content

Commit 8979be1

Browse files
committed
Support for TEAMID_SUFFIX
Add TEAMID_SUFFIX repository variable to allow multiple unique Bundle IDs Add xcargs to change MAIN_APP_BUNDLE_IDENTIFIER when a suffix is used. Integrate TEAMID_SUFFIX into TEAM_ID variable
1 parent 53c0e62 commit 8979be1

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

.github/workflows/add_identifiers.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
run: bundle exec fastlane identifiers
4343
env:
4444
TEAMID: ${{ secrets.TEAMID }}
45+
TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }}
4546
GH_PAT: ${{ secrets.GH_PAT }}
4647
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
4748
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }}

.github/workflows/build_loop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ jobs:
235235
run: bundle exec fastlane build_loop
236236
env:
237237
TEAMID: ${{ secrets.TEAMID }}
238+
TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }}
238239
GH_PAT: ${{ secrets.GH_PAT }}
239240
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }}
240241
FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }}
@@ -246,6 +247,7 @@ jobs:
246247
run: bundle exec fastlane release
247248
env:
248249
TEAMID: ${{ secrets.TEAMID }}
250+
TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }}
249251
GH_PAT: ${{ secrets.GH_PAT }}
250252
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }}
251253
FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }}

.github/workflows/create_certs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: [workflow_call, workflow_dispatch]
55

66
env:
77
TEAMID: ${{ secrets.TEAMID }}
8+
TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }}
89
GH_PAT: ${{ secrets.GH_PAT }}
910
GH_TOKEN: ${{ secrets.GH_PAT }}
1011
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

.github/workflows/validate_secrets.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ jobs:
114114
FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }}
115115
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
116116
TEAMID: ${{ secrets.TEAMID }}
117+
TEAMID_SUFFIX: ${{ vars.TEAMID_SUFFIX }}
117118
steps:
118119
- name: Checkout Repo
119120
uses: actions/checkout@v4
@@ -141,6 +142,17 @@ jobs:
141142
echo "::error::The TEAMID secret is set but invalid. Verify that it is set correctly (only uppercase letters and numbers) and try again."
142143
fi
143144
145+
# Validate TEAMID_SUFFIX
146+
if [ -z "$TEAMID_SUFFIX" ]; then
147+
echo "::notice::No TEAMID_SUFFIX variable is set."
148+
elif [ ${#TEAMID_SUFFIX} -gt 5 ]; then
149+
failed=true
150+
echo "::error::The TEAMID_SUFFIX variable is set but is too long. Verify that it the length is between 1 and 5 characters and try again."
151+
elif ! [[ $TEAMID_SUFFIX =~ ^[A-Z0-9]+$ ]]; then
152+
failed=true
153+
echo "::error::The TEAMID_SUFFIX variable is set but invalid. Verify that it is set correctly (only uppercase letters and numbers) and try again."
154+
fi
155+
144156
# Validate MATCH_PASSWORD
145157
if [ -z "$MATCH_PASSWORD" ]; then
146158
failed=true

fastlane/Fastfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
default_platform(:ios)
1414

15-
TEAMID = ENV["TEAMID"]
15+
TEAMID = ENV["TEAMID_SUFFIX"].to_s.empty? ? "#{ENV["TEAMID"]}" : "#{ENV["TEAMID"]}-#{ENV["TEAMID_SUFFIX"]}"
1616
GH_PAT = ENV["GH_PAT"]
1717
GITHUB_WORKSPACE = ENV["GITHUB_WORKSPACE"]
1818
GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"]
@@ -123,6 +123,7 @@ platform :ios do
123123
configuration: "Release",
124124
destination: 'generic/platform=iOS',
125125
buildlog_path: 'buildlog'
126+
xcargs: "MAIN_APP_BUNDLE_IDENTIFIER=com.#{TEAMID}.loopkit.Loop"
126127
)
127128

128129
copy_artifacts(

0 commit comments

Comments
 (0)