24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'fastlane/lib/fastlane/actions/installr.rb', line 24
def self.upload_build(params)
require 'faraday'
require 'faraday_middleware'
url = INSTALLR_API
connection = Faraday.new(url) do |builder|
builder.request(:multipart)
builder.request(:url_encoded)
builder.response(:json, content_type: /\bjson$/)
builder.use(FaradayMiddleware::FollowRedirects)
builder.adapter(:net_http)
end
options = {}
options[:qqfile] = Faraday::UploadIO.new(params[:ipa], 'application/octet-stream')
if params[:notes]
options[:releaseNotes] = params[:notes]
end
if params[:notify]
options[:notify] = params[:notify]
end
if params[:add]
options[:add] = params[:add]
end
post_request = connection.post do |req|
req.['X-InstallrAppToken'] = params[:api_token]
req.body = options
end
post_request.on_complete do |env|
yield(env[:status], env[:body]) if block_given?
end
end
|