8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/fastlane/actions/crashlytics.rb', line 8
def self.run(params)
require 'shenzhen'
require 'shenzhen/plugins/crashlytics'
assert_params_given!(params)
params = params.first
crashlytics_path = params[:crashlytics_path]
api_token = params[:api_token]
build_secret = params[:build_secret]
ipa_path = params[:ipa_path] || Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
notes_path = params[:notes_path]
emails = params[:emails]
groups = params[:groups]
assert_valid_params!(crashlytics_path, api_token, build_secret, ipa_path)
Helper.log.info 'Uploading the IPA to Crashlytics. Go for a coffee ☕️.'.green
return if Helper.test?
client = Shenzhen::Plugins::Crashlytics::Client.new(crashlytics_path, api_token, build_secret)
response = client.upload_build(ipa_path, file: ipa_path, notes: notes_path, emails: emails, groups: groups)
if response
Helper.log.info 'Build successfully uploaded to Crashlytics'.green
else
Helper.log.fatal 'Error uploading to Crashlytics.'
raise 'Error when trying to upload ipa to Crashlytics'.red
end
end
|