Skip to content

Commit 3736a90

Browse files
[CI] Update TestFlight app version on manual uploading (#821)
1 parent c341d30 commit 3736a90

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

.github/workflows/testflight.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ on:
99
types: [published]
1010

1111
workflow_dispatch:
12+
inputs:
13+
release:
14+
description: 'Build configuration'
15+
required: true
16+
default: 'Debug'
17+
type: choice
18+
options:
19+
- Debug
20+
- Release
1221

1322
env:
1423
HOMEBREW_NO_INSTALL_CLEANUP: 1
@@ -32,7 +41,7 @@ jobs:
3241
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
3342
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3443
GITHUB_PR_NUM: ${{ github.event.number }}
35-
run: bundle exec fastlane swiftui_testflight_build
44+
run: bundle exec fastlane swiftui_testflight_build configuration:"${{ github.event.inputs.release }}"
3645
- uses: 8398a7/action-slack@v3
3746
with:
3847
status: ${{ job.status }}

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ GEM
207207
fastlane
208208
pry
209209
fastlane-plugin-sonarcloud_metric_kit (0.2.1)
210-
fastlane-plugin-stream_actions (0.3.78)
210+
fastlane-plugin-stream_actions (0.3.79)
211211
xctest_list (= 1.2.1)
212212
fastlane-plugin-versioning (0.7.1)
213213
fastlane-sirp (1.0.0)
@@ -440,7 +440,7 @@ DEPENDENCIES
440440
fastlane-plugin-create_xcframework
441441
fastlane-plugin-lizard
442442
fastlane-plugin-sonarcloud_metric_kit
443-
fastlane-plugin-stream_actions (= 0.3.78)
443+
fastlane-plugin-stream_actions (= 0.3.79)
444444
fastlane-plugin-versioning
445445
jazzy
446446
json

fastlane/Fastfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,31 @@ lane :match_me do |options|
217217
end
218218

219219
desc 'Builds the latest version of Demo app and uploads it to TestFlight'
220-
lane :swiftui_testflight_build do
220+
lane :swiftui_testflight_build do |options|
221+
is_manual_upload = is_localhost || !options[:configuration].to_s.empty?
222+
configuration = options[:configuration].to_s.empty? ? 'Release' : options[:configuration]
223+
221224
match_me
225+
226+
sdk_version = get_sdk_version_from_environment
227+
app_version =
228+
if is_manual_upload
229+
major, minor, _patch = sdk_version.split('.').map(&:to_i)
230+
minor += 1
231+
"#{major}.#{minor}.0"
232+
else
233+
sdk_version
234+
end
235+
UI.important("[TestFlight] Uploading DemoApp version: #{app_version}")
236+
222237
testflight_build(
223238
api_key: appstore_api_key,
224239
xcode_project: xcode_project,
225240
sdk_target: 'StreamChatSwiftUI',
241+
app_version: app_version,
226242
app_target: 'DemoAppSwiftUI',
227243
app_identifier: 'io.getstream.iOS.DemoAppSwiftUI',
228-
app_version: File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+)"/)[1]
244+
configuration: configuration
229245
)
230246
end
231247

fastlane/Pluginfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
gem 'fastlane-plugin-versioning'
66
gem 'fastlane-plugin-sonarcloud_metric_kit'
77
gem 'fastlane-plugin-create_xcframework'
8-
gem 'fastlane-plugin-stream_actions', '0.3.78'
8+
gem 'fastlane-plugin-stream_actions', '0.3.79'

0 commit comments

Comments
 (0)