From 3b6d33fa76e743c68aae4ed6e0cad416471b836b Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Thu, 1 May 2025 10:45:00 +0100 Subject: [PATCH] [CI] Update TestFlight app version on manual uploading --- .github/workflows/testflight.yml | 11 ++++++++++- Gemfile.lock | 4 ++-- fastlane/Fastfile | 19 ++++++++++++++++++- fastlane/Pluginfile | 2 +- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml index 168c6ad577..6b74efb36a 100644 --- a/.github/workflows/testflight.yml +++ b/.github/workflows/testflight.yml @@ -9,6 +9,15 @@ on: types: [published] workflow_dispatch: + inputs: + release: + description: 'Build configuration' + required: true + default: 'Debug' + type: choice + options: + - Debug + - Release env: HOMEBREW_NO_INSTALL_CLEANUP: 1 @@ -30,7 +39,7 @@ jobs: APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PR_NUM: ${{ github.event.number }} - run: bundle exec fastlane uikit_testflight_build + run: bundle exec fastlane uikit_testflight_build configuration:"${{ github.event.inputs.release }}" - uses: 8398a7/action-slack@v3 with: status: ${{ job.status }} diff --git a/Gemfile.lock b/Gemfile.lock index 25d4616002..3423b90e87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -208,7 +208,7 @@ GEM fastlane pry fastlane-plugin-sonarcloud_metric_kit (0.2.1) - fastlane-plugin-stream_actions (0.3.78) + fastlane-plugin-stream_actions (0.3.79) xctest_list (= 1.2.1) fastlane-plugin-versioning (0.7.1) fastlane-sirp (1.0.0) @@ -459,7 +459,7 @@ DEPENDENCIES fastlane-plugin-create_xcframework fastlane-plugin-lizard fastlane-plugin-sonarcloud_metric_kit - fastlane-plugin-stream_actions (= 0.3.78) + fastlane-plugin-stream_actions (= 0.3.79) fastlane-plugin-versioning faye-websocket jazzy diff --git a/fastlane/Fastfile b/fastlane/Fastfile index b39aaa674a..c108679650 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -273,14 +273,31 @@ lane :match_me do |options| end desc 'Builds the latest version of Demo app and uploads it to TestFlight' -lane :uikit_testflight_build do +lane :uikit_testflight_build do |options| + is_manual_upload = is_localhost || !options[:configuration].to_s.empty? + configuration = options[:configuration].to_s.empty? ? 'Release' : options[:configuration] + match_me + + sdk_version = get_sdk_version_from_environment + app_version = + if is_manual_upload + major, minor, _patch = sdk_version.split('.').map(&:to_i) + minor += 1 + "#{major}.#{minor}.0" + else + sdk_version + end + UI.important("[TestFlight] Uploading DemoApp version: #{app_version}") + testflight_build( api_key: appstore_api_key, xcode_project: xcode_project, sdk_target: 'StreamChat', app_target: 'DemoApp', + app_version: app_version, app_identifier: 'io.getstream.iOS.ChatDemoApp', + configuration: configuration, extensions: ['DemoShare'] ) end diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 65f1b653bd..dcc7813c3b 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -5,4 +5,4 @@ gem 'fastlane-plugin-versioning' gem 'fastlane-plugin-create_xcframework' gem 'fastlane-plugin-sonarcloud_metric_kit' -gem 'fastlane-plugin-stream_actions', '0.3.78' +gem 'fastlane-plugin-stream_actions', '0.3.79'