Skip to content

Commit cd1f561

Browse files
committed
feat: enable automatic TestFlight beta distribution
- Wait for build processing before attempting distribution - Add encryption export compliance declaration - Auto-submit for beta review when needed - Add distribute_beta lane for manual distribution - Increase timeout to 60 minutes for processing - Add script to distribute existing builds
1 parent df4aaf2 commit cd1f561

File tree

3 files changed

+59
-6
lines changed

3 files changed

+59
-6
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ jobs:
277277
fastlane match appstore --readonly
278278
279279
- name: Build and Upload to TestFlight
280-
timeout-minutes: 45
280+
timeout-minutes: 60
281281
env:
282282
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
283283
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
@@ -286,7 +286,11 @@ jobs:
286286
# Enable verbose output for debugging
287287
export FASTLANE_VERBOSE=true
288288
289-
# Run the beta lane
289+
# Ensure we're using the correct locale for Fastlane
290+
export LC_ALL=en_US.UTF-8
291+
export LANG=en_US.UTF-8
292+
293+
# Run the beta lane (includes waiting for processing and distribution)
290294
fastlane beta
291295
292296
- name: Create GitHub Release

distribute_current_build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Script to distribute the current TestFlight build to beta testers
4+
# This is useful when a build was uploaded but not automatically distributed
5+
6+
echo "🚀 Distributing current TestFlight build to beta testers..."
7+
8+
# Run the distribute_beta lane to handle the latest build
9+
fastlane distribute_beta
10+
11+
echo "✅ Distribution process completed!"

fastlane/Fastfile

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,39 @@ platform :ios do
5050
)
5151
end
5252

53+
desc "Distribute existing build to beta testers"
54+
lane :distribute_beta do |options|
55+
# Get App Store Connect API key
56+
api_key = get_api_key
57+
58+
# Get the build number to distribute (optional)
59+
build_number = options[:build_number]
60+
61+
if build_number
62+
# Distribute specific build
63+
distribute_build(
64+
api_key: api_key,
65+
build_number: build_number,
66+
groups: ["Beta Testers"],
67+
notify_external_testers: true,
68+
uses_non_exempt_encryption: false,
69+
submit_beta_review: true
70+
)
71+
else
72+
# Wait for latest build to process and distribute
73+
testflight(
74+
api_key: api_key,
75+
skip_submission: false,
76+
distribute_external: true,
77+
groups: ["Beta Testers"],
78+
notify_external_testers: true,
79+
uses_non_exempt_encryption: false,
80+
submit_beta_review: true,
81+
wait_for_uploaded_build: true
82+
)
83+
end
84+
end
85+
5386
desc "Build and upload to TestFlight"
5487
lane :beta do
5588
# Ensure we have the latest certificates
@@ -105,11 +138,16 @@ platform :ios do
105138
upload_to_testflight(
106139
api_key: api_key,
107140
skip_submission: false,
108-
skip_waiting_for_build_processing: true,
109-
distribute_external: true,
110-
groups: ["Beta Testers"],
141+
skip_waiting_for_build_processing: false, # Wait for processing before distribution
142+
wait_processing_interval: 30, # Check every 30 seconds
143+
wait_processing_timeout_duration: 900, # Wait up to 15 minutes for processing
144+
distribute_external: true, # Distribute to external testers
145+
distribute_only: false, # Upload and distribute in one action
146+
groups: ["External Testers", "Beta Testers"], # Try common group names
111147
changelog: "Bug fixes and improvements",
112-
notify_external_testers: true
148+
notify_external_testers: true, # Send email notifications
149+
uses_non_exempt_encryption: false, # Required for automatic distribution
150+
submit_beta_review: true # Automatically submit for beta review if needed
113151
)
114152

115153
# Notify success

0 commit comments

Comments
 (0)