Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deliver] update deliver/runner.rb to handle both ipa and pkg paths. #20043

Merged
merged 6 commits into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 31 additions & 35 deletions deliver/lib/deliver/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,35 +165,33 @@ def upload_metadata
def verify_binary
UI.message("Verifying binary with App Store Connect")

verify_ipa = options[:ipa]
verify_pkg = options[:pkg]

# 2020-01-27
# Only verify platform if if both ipa and pkg exists (for backwards support)
if verify_ipa && verify_pkg
verify_ipa = ["ios", "appletvos"].include?(options[:platform])
verify_pkg = options[:platform] == "osx"
end
ipa_path = options[:ipa]
pkg_path = options[:pkg]

platform = options[:platform]
transporter = transporter_for_selected_team

if verify_ipa
case platform
when "ios", "appletvos"
package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(
app_id: Deliver.cache[:app].id,
ipa_path: options[:ipa],
ipa_path: ipa_path,
package_path: "/tmp",
platform: options[:platform]
platform: platform
)
elsif verify_pkg
result = transporter.verify(package_path: package_path)
when "osx"
package_path = FastlaneCore::PkgUploadPackageBuilder.new.generate(
app_id: Deliver.cache[:app].id,
pkg_path: options[:pkg],
pkg_path: pkg_path,
package_path: "/tmp",
platform: options[:platform]
platform: platform
)
result = transporter.verify(package_path: package_path)
else
UI.user_error!("No suitable file found for verify for platform: #{options[:platform]}")
end

transporter = transporter_for_selected_team
result = transporter.verify(package_path: package_path)

unless result
transporter_errors = transporter.displayable_errors
UI.user_error!("Error verifying the binary file: \n #{transporter_errors}")
Expand All @@ -204,35 +202,33 @@ def verify_binary
def upload_binary
UI.message("Uploading binary to App Store Connect")

upload_ipa = options[:ipa]
upload_pkg = options[:pkg]
ipa_path = options[:ipa]
pkg_path = options[:pkg]

# 2020-01-27
# Only verify platform if if both ipa and pkg exists (for backwards support)
if upload_ipa && upload_pkg
upload_ipa = ["ios", "appletvos"].include?(options[:platform])
upload_pkg = options[:platform] == "osx"
end
platform = options[:platform]
transporter = transporter_for_selected_team

if upload_ipa
case platform
when "ios", "appletvos"
package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(
app_id: Deliver.cache[:app].id,
ipa_path: options[:ipa],
ipa_path: ipa_path,
package_path: "/tmp",
platform: options[:platform]
platform: platform
)
elsif upload_pkg
result = transporter.upload(package_path: package_path, asset_path: ipa_path)
when "osx"
package_path = FastlaneCore::PkgUploadPackageBuilder.new.generate(
app_id: Deliver.cache[:app].id,
pkg_path: options[:pkg],
pkg_path: pkg_path,
package_path: "/tmp",
platform: options[:platform]
platform: platform
)
result = transporter.upload(package_path: package_path, asset_path: pkg_path)
else
UI.user_error!("No suitable file found for upload for platform: #{options[:platform]}")
end

transporter = transporter_for_selected_team
result = transporter.upload(package_path: package_path, asset_path: upload_ipa || upload_pkg)

unless result
transporter_errors = transporter.displayable_errors
UI.user_error!("Error uploading ipa file: \n #{transporter_errors}")
Expand Down