Skip to content

Commit

Permalink
Allow to specify the app_version when uploading to testflight
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Oct 29, 2024
1 parent a8a9811 commit eb82065
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 19 additions & 5 deletions lib/fastlane/plugin/stream_actions/actions/testflight_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@ def self.run(params)
api_key: params[:api_key]
) + 1

Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key])
app_store_versions = Spaceship::ConnectAPI::App.find(params[:app_identifier]).app_store_versions

targets = params[:extensions] << params[:app_target]

targets.each do |target|
other_action.increment_build_number_in_plist(build_number: build_number.to_s, target: target)
next if app_store_versions.empty?
end

other_action.increment_version_number_in_plist(version_number: app_store_versions.first.version_string, target: target)
if params[:app_version]
targets.each do |target|
other_action.increment_version_number_in_plist(version_number: params[:app_version].to_s, target: target)
end
else
Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key])
app_store_versions = Spaceship::ConnectAPI::App.find(params[:app_identifier]).app_store_versions
unless app_store_versions.empty?
targets.each do |target|
other_action.increment_version_number_in_plist(version_number: app_store_versions.first.version_string, target: target)
end
end
end

other_action.gym(
Expand Down Expand Up @@ -102,6 +111,11 @@ def self.available_options
UI.user_error!('DemoApp target name has to be specified') if target.nil? || target.empty?
end
),
FastlaneCore::ConfigItem.new(
key: :app_version,
description: 'DemoApp version',
optional: true
),
FastlaneCore::ConfigItem.new(
key: :extensions,
description: 'Extensions/dependencies target names to bump build number',
Expand Down
2 changes: 1 addition & 1 deletion lib/fastlane/plugin/stream_actions/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Fastlane
module StreamActions
VERSION = '0.3.70'
VERSION = '0.3.71'
end
end

0 comments on commit eb82065

Please sign in to comment.