fastlane/lib/fastlane/actions/testfairy.rb in fastlane-2.146.1 vs fastlane/lib/fastlane/actions/testfairy.rb in fastlane-2.147.0
- old
+ new
@@ -1,9 +1,11 @@
module Fastlane
module Actions
module SharedValues
TESTFAIRY_BUILD_URL = :TESTFAIRY_BUILD_URL
+ TESTFAIRY_DOWNLOAD_URL = :TESTFAIRY_DOWNLOAD_URL
+ TESTFAIRY_LANDING_PAGE = :TESTFAIRY_LANDING_PAGE
end
class TestfairyAction < Action
def self.upload_build(upload_url, ipa, options, timeout)
require 'faraday'
@@ -105,10 +107,12 @@
return path if Helper.test?
response = self.upload_build(params[:upload_url], path, client_options, params[:timeout])
if parse_response(response)
UI.success("Build URL: #{Actions.lane_context[SharedValues::TESTFAIRY_BUILD_URL]}")
+ UI.success("Download URL: #{Actions.lane_context[SharedValues::TESTFAIRY_DOWNLOAD_URL]}")
+ UI.success("Landing Page URL: #{Actions.lane_context[SharedValues::TESTFAIRY_LANDING_PAGE]}")
UI.success("Build successfully uploaded to TestFairy.")
else
UI.user_error!("Error when trying to upload ipa to TestFairy")
end
end
@@ -118,12 +122,16 @@
#####################################################
def self.parse_response(response)
if response.body && response.body.key?('status') && response.body['status'] == 'ok'
build_url = response.body['build_url']
+ app_url = response.body['app_url']
+ landing_page_url = response.body['landing_page_url']
Actions.lane_context[SharedValues::TESTFAIRY_BUILD_URL] = build_url
+ Actions.lane_context[SharedValues::TESTFAIRY_DOWNLOAD_URL] = app_url
+ Actions.lane_context[SharedValues::TESTFAIRY_LANDING_PAGE] = landing_page_url
return true
else
UI.error("Error uploading to TestFairy: #{response.body}")
@@ -242,25 +250,32 @@
[
'testfairy(
api_key: "...",
ipa: "./ipa_file.ipa",
comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}",
- )'
+ )',
+ 'testfairy(
+ api_key: "...",
+ apk: "../build/app/outputs/apk/qa/release/app-qa-release.apk",
+ comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}",
+ )'
]
end
def self.category
:beta
end
def self.output
[
- ['TESTFAIRY_BUILD_URL', 'URL of the newly uploaded build']
+ ['TESTFAIRY_BUILD_URL', 'URL for the sessions of the newly uploaded build'],
+ ['TESTFAIRY_DOWNLOAD_URL', 'URL directly to the newly uploaded build'],
+ ['TESTFAIRY_LANDING_PAGE', 'URL of the build\'s landing page']
]
end
def self.authors
- ["taka0125", "tcurdt", "vijaysharm"]
+ ["taka0125", "tcurdt", "vijaysharm", "cdm2012"]
end
def self.is_supported?(platform)
[:ios, :android].include?(platform)
end