Skip to content

Commit 97773fc

Browse files
committed
upload to internal TestFlight
1 parent 549c65a commit 97773fc

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/runway_ios_rc_workflow.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,14 @@ jobs:
217217
APP_STORE_CONNECT_API_KEY_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_CONTENT }}
218218

219219
- name: Upload to TestFlight
220+
env:
221+
# Runway / GH apple env uses a restricted key; Bitrise keeps default external distribution.
222+
TESTFLIGHT_DISTRIBUTE_EXTERNAL: 'false'
220223
run: |
221224
bash scripts/upload-to-testflight.sh \
222225
"github_actions_main-rc" \
223226
"${{ inputs.ref || github.ref_name }}" \
224-
"${{ steps.ipa.outputs.path }}" \
225-
"MetaMask BETA & Release Candidates"
227+
"${{ steps.ipa.outputs.path }}"
226228
227229
- name: Cleanup API Key
228230
if: always()

ios/fastlane/Fastfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ platform :ios do
2020
# Convert groups parameter to array (Fastlane CLI passes strings, not arrays)
2121
groups_param = options[:groups] || ['MetaMask BETA & Release Candidates']
2222
groups = groups_param.is_a?(Array) ? groups_param : [groups_param]
23-
notify_external_testers = true
23+
# Default: distribute to external TestFlight groups (matches historical Fastlane / Bitrise behavior).
24+
# Set TESTFLIGHT_DISTRIBUTE_EXTERNAL=false (or 0/no/off) when the API key cannot manage beta groups
25+
# (upload still succeeds for internal TestFlight; external step would return "forbidden for security reasons").
26+
tf_ext = ENV.fetch('TESTFLIGHT_DISTRIBUTE_EXTERNAL', 'true').to_s.strip.downcase
27+
distribute_external = !%w[false 0 no off].include?(tf_ext)
28+
notify_external_testers = distribute_external
2429

2530
if ipa_path.nil? || ipa_path.empty?
2631
UI.user_error!("You must provide an ipa_path using ipa_path: '/path/to/app.ipa'")
@@ -93,14 +98,15 @@ platform :ios do
9398
)
9499

95100
# Upload to TestFlight with API key from app_store_connect_api_key action
96-
upload_to_testflight(
101+
upload_params = {
97102
api_key: api_key,
98103
ipa: ipa_path,
99-
distribute_external: true,
100-
groups: groups,
104+
distribute_external: distribute_external,
101105
notify_external_testers: notify_external_testers,
102106
changelog: changelog_message
103-
)
107+
}
108+
upload_params[:groups] = groups if distribute_external
109+
upload_to_testflight(**upload_params)
104110
end
105111
end
106112

ios/fastlane/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This Fastlane configuration handles uploading iOS builds to TestFlight via Bitri
44

55
## Overview
66

7-
The `upload_to_testflight_only` lane uploads pre-built IPA files to TestFlight and distributes them to external testing groups.
7+
The `upload_to_testflight_only` lane uploads pre-built IPA files to TestFlight and, by default, distributes them to external testing groups (same as historical Bitrise behavior). Set `TESTFLIGHT_DISTRIBUTE_EXTERNAL=false` (or `0`, `no`, `off`) for upload-only when the App Store Connect API key cannot manage external beta groups.
88

99
## GitHub Actions
1010

scripts/upload-to-testflight.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#
1515
# Environment variables:
1616
# IPA_PATH - IPA path (set by find-ipa-file.sh if not provided as argument)
17+
# TESTFLIGHT_DISTRIBUTE_EXTERNAL - Default "true": distribute to external TestFlight groups after upload.
18+
# Set to "false" (or 0/no/off) for upload-only when the API key lacks App Manager access to beta groups.
1719

1820
set -e
1921

0 commit comments

Comments
 (0)