Skip to content

Commit 2162454

Browse files
graycreateclaude
andauthored
feat: add public beta distribution option to release workflow (#114)
* feat: add public beta distribution option to release workflow Add a new workflow dispatch parameter `distribute_to_public_beta` that allows optionally auto-distributing builds to the public beta group on TestFlight after upload. When enabled: - Waits for Apple's build processing to complete - Automatically distributes to external testers (Public Beta groups) - Sends email notifications to testers - Submits for Beta review - Includes changelog from CHANGELOG.md Default behavior unchanged - builds are uploaded without waiting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: add error handling for public beta distribution Address Copilot review feedback by wrapping the public beta distribution upload_to_testflight call in a begin/rescue block to handle potential failures gracefully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3616474 commit 2162454

File tree

2 files changed

+62
-20
lines changed

2 files changed

+62
-20
lines changed

.github/workflows/release-public.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
required: false
1414
default: false
1515
type: boolean
16+
distribute_to_public_beta:
17+
description: 'Auto distribute to public beta group after upload'
18+
required: false
19+
default: false
20+
type: boolean
1621

1722
env:
1823
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
@@ -285,6 +290,7 @@ jobs:
285290
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
286291
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
287292
TEAM_ID: ${{ secrets.TEAM_ID }}
293+
DISTRIBUTE_TO_PUBLIC_BETA: ${{ github.event.inputs.distribute_to_public_beta || 'false' }}
288294
run: |
289295
# Enable verbose output for debugging
290296
export FASTLANE_VERBOSE=true

fastlane/Fastfile

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,26 +163,62 @@ platform :ios do
163163
# Build the app
164164
build_ipa
165165

166-
# Upload to TestFlight
167-
# NOTE: We skip waiting for build processing to avoid timeout issues.
168-
# Apple's build processing can take 5-30 minutes, which often exceeds reasonable timeout limits.
169-
# Distribution to testers can be done after processing completes using: fastlane distribute_beta
170-
upload_to_testflight(
171-
api_key: api_key,
172-
skip_submission: false,
173-
skip_waiting_for_build_processing: true, # Don't wait - avoid timeout issues
174-
distribute_external: false, # Can't distribute until Apple finishes processing
175-
uses_non_exempt_encryption: false
176-
# NOTE: changelog parameter intentionally omitted
177-
# Even with skip_waiting_for_build_processing: true, providing a changelog
178-
# causes fastlane to wait for the build to appear in App Store Connect,
179-
# which defeats the purpose of skipping. Changelog can be added manually
180-
# in App Store Connect or when distributing with: fastlane distribute_beta
181-
)
182-
183-
UI.success("✅ Build uploaded successfully to TestFlight!")
184-
UI.important("📦 Build will be available for testing once Apple finishes processing (usually 5-30 minutes)")
185-
UI.important("🔔 You can distribute to testers using: fastlane distribute_beta")
166+
# Check if we should distribute to public beta
167+
distribute_to_public_beta = ENV["DISTRIBUTE_TO_PUBLIC_BETA"] == "true"
168+
169+
if distribute_to_public_beta
170+
begin
171+
# Upload to TestFlight and wait for processing to distribute to public beta
172+
UI.message("📦 Will distribute to public beta group after upload...")
173+
upload_to_testflight(
174+
api_key: api_key,
175+
skip_submission: false,
176+
skip_waiting_for_build_processing: false, # Wait for processing to distribute
177+
distribute_external: true, # Distribute to external testers (public beta)
178+
groups: ["Public Beta", "External Testers", "Beta Testers"], # Public beta groups
179+
notify_external_testers: true, # Send email notifications
180+
uses_non_exempt_encryption: false,
181+
submit_beta_review: true, # Automatically submit for Beta review
182+
changelog: ChangelogHelper.get_current_changelog || "Bug fixes and improvements",
183+
beta_app_description: "V2er is an elegant third-party client for V2EX forum",
184+
beta_app_feedback_email: "hi@v2er.app",
185+
demo_account_required: false,
186+
beta_app_review_info: {
187+
contact_email: "hi@v2er.app",
188+
contact_first_name: "V2er",
189+
contact_last_name: "Support",
190+
contact_phone: "+86 13800138000",
191+
notes: "This is a third-party client app for V2EX forum. No special account needed for testing."
192+
}
193+
)
194+
UI.success("✅ Build uploaded and distributed to public beta testers!")
195+
UI.success("📧 External testers will be notified via email")
196+
rescue => e
197+
UI.error("Failed to distribute to public beta: #{e.message}")
198+
UI.message("Build may have been uploaded but distribution failed")
199+
UI.message("You can manually distribute using: fastlane distribute_beta")
200+
end
201+
else
202+
# Upload to TestFlight without waiting (original behavior)
203+
# NOTE: We skip waiting for build processing to avoid timeout issues.
204+
# Apple's build processing can take 5-30 minutes, which often exceeds reasonable timeout limits.
205+
# Distribution to testers can be done after processing completes using: fastlane distribute_beta
206+
upload_to_testflight(
207+
api_key: api_key,
208+
skip_submission: false,
209+
skip_waiting_for_build_processing: true, # Don't wait - avoid timeout issues
210+
distribute_external: false, # Can't distribute until Apple finishes processing
211+
uses_non_exempt_encryption: false
212+
# NOTE: changelog parameter intentionally omitted
213+
# Even with skip_waiting_for_build_processing: true, providing a changelog
214+
# causes fastlane to wait for the build to appear in App Store Connect,
215+
# which defeats the purpose of skipping. Changelog can be added manually
216+
# in App Store Connect or when distributing with: fastlane distribute_beta
217+
)
218+
UI.success("✅ Build uploaded successfully to TestFlight!")
219+
UI.important("📦 Build will be available for testing once Apple finishes processing (usually 5-30 minutes)")
220+
UI.important("🔔 You can distribute to testers using: fastlane distribute_beta")
221+
end
186222

187223
# Notify success
188224
notification(

0 commit comments

Comments
 (0)