Skip to content

Commit b7cbab4

Browse files
authored
Merge branch 'master' into fix/thread-state-portable
2 parents 7946a52 + 8f77232 commit b7cbab4

4 files changed

Lines changed: 96 additions & 1 deletion

File tree

.github/workflows/distribute_internal.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,52 @@ jobs:
149149
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
150150
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
151151
run: bundle exec fastlane distribute_to_firebase
152+
153+
ios_testflight:
154+
needs: determine_platforms
155+
if: ${{ needs.determine_platforms.outputs.run_ios == 'true' }}
156+
runs-on: macos-15 # Requires xcode 15 or later
157+
timeout-minutes: 30
158+
steps:
159+
- name: Connect Bot
160+
uses: webfactory/ssh-agent@v0.9.1
161+
with:
162+
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
163+
164+
- name: "Git Checkout"
165+
uses: actions/checkout@v6
166+
with:
167+
fetch-depth: 0
168+
169+
- uses: maxim-lobanov/setup-xcode@v1
170+
with:
171+
xcode-version: '26.3'
172+
173+
- name: "Install Flutter"
174+
uses: subosito/flutter-action@v2
175+
with:
176+
flutter-version: ${{ env.FLUTTER_VERSION }}
177+
channel: stable
178+
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
179+
180+
- name: "Disable Swift Package Manager"
181+
run: flutter config --no-enable-swift-package-manager
182+
183+
- name: "Install Tools"
184+
run: flutter pub global activate melos
185+
186+
- name: "Bootstrap Workspace"
187+
run: melos bootstrap
188+
189+
- name: Setup Ruby
190+
uses: ruby/setup-ruby@v1
191+
with:
192+
bundler-cache: true
193+
working-directory: sample_app/ios
194+
195+
- name: Distribute to TestFlight Internal
196+
working-directory: sample_app/ios
197+
env:
198+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
199+
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
200+
run: bundle exec fastlane distribute_to_testflight_internal

sample_app/ios/fastlane/Fastfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,32 @@ platform :ios do
120120
)
121121
end
122122

123+
desc "Build and distribute app to TestFlight Internal Testers with auto-incrementing build number"
124+
# Usage: bundle exec fastlane ios distribute_to_testflight_internal
125+
lane :distribute_to_testflight_internal do
126+
match_me
127+
128+
current_build_number = latest_testflight_build_number(
129+
api_key: appstore_api_key,
130+
app_identifier: app_identifier
131+
)
132+
133+
build_number = (current_build_number || 0).to_i + 1
134+
build_ipa(export_method: "app-store", build_number: build_number)
135+
136+
upload_dsyms_to_crashlytics
137+
138+
upload_to_testflight(
139+
api_key: appstore_api_key,
140+
distribute_external: false,
141+
notify_external_testers: false,
142+
ipa: "#{root_path}/build/ios/ipa/ChatSample.ipa",
143+
groups: ['Internal Testers'],
144+
changelog: 'Lots of amazing new features to test out!',
145+
skip_waiting_for_build_processing: true,
146+
)
147+
end
148+
123149
desc "Upload iOS dSYMs from the most recent `flutter build ipa` to Firebase Crashlytics"
124150
private_lane :upload_dsyms_to_crashlytics do
125151
dsym_zip = zip(

sample_app/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: sample_app
22
description: A new Flutter project.
33
publish_to: "none"
4-
version: 2.2.0
4+
version: 9.24.0
55

66
# Note: The environment configuration and dependency versions are managed by Melos.
77
#

tools/generate_version.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,24 @@ Future<void> main() async {
4040
await versionFile.writeAsString(updatedContent);
4141

4242
print('✓ Successfully updated version to $version in $versionFilePath');
43+
44+
var cleanedVersion = version;
45+
if (cleanedVersion.contains('-')) {
46+
cleanedVersion = cleanedVersion.split('-').first;
47+
48+
print('Cleaned version for app: $cleanedVersion');
49+
}
50+
51+
// Update the version in the sample_app pubspec.yaml
52+
final sampleAppPubspecPath = p.join(rootDir, 'sample_app', 'pubspec.yaml');
53+
final sampleAppPubspec = File(sampleAppPubspecPath).readAsStringSync();
54+
final updatedSampleAppPubspec = sampleAppPubspec.replaceFirst(
55+
RegExp('version: .+'),
56+
'version: $cleanedVersion',
57+
);
58+
59+
await File(sampleAppPubspecPath).writeAsString(updatedSampleAppPubspec);
60+
61+
print(
62+
'✓ Successfully updated version to $cleanedVersion in $sampleAppPubspecPath');
4363
}

0 commit comments

Comments
 (0)