fastlane-plugin-upload_dsym_to_bugly 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18388202b1fa50ea78fbac2ed0d2dd59071fbe67fb6cdf36dd1f3d2350aeb9c2
4
- data.tar.gz: 1b99b735d5b5ff70750387881d066e2a00a9cc0026a8c3af6fcefccc1c5e739a
3
+ metadata.gz: e5c6d8fb01161391981fb9bde20dea2336c107189dd84b16854bf00c33a632b2
4
+ data.tar.gz: ed3378e92801987b5972afcc097956b7c7fb864f0e26af538bbbcc6e1e8fa927
5
5
  SHA512:
6
- metadata.gz: d3449496b295f0b2df771d3dcc2735e518732394edd18acb9ab3cd4b2aa9cc8705a03c829a16e6d6c92f82ed35b339fe1fe169ec3bdf7c4c9c949828d7e1c5db
7
- data.tar.gz: 0bd70a22d68dcc6ef59f0b61cf205ee8757ea3e6adb57cc64b067d40f342173c84d2ec4c05514c2a929c4a56d05470e11540ad9cc7c7f3bd9f77e21c97abb502
6
+ metadata.gz: 177bde3c38855222dff3aa3ebef497041c486d57c7695dbb69c00a1e15cd239f23eebc0f4a0db2d119010665d0e089edf02c2fd27b59061e49cc60f0986df1f8
7
+ data.tar.gz: 8d54f91666b357f88e83aa7c1d66abc767dcb980d84b4e4bd48c1a0361ec84198db351427c4009b0edb03428ae7243f4a284fd35bdd7831b3e27f0718139df6d
@@ -5,7 +5,42 @@ module Fastlane
5
5
  module Actions
6
6
  class UploadDsymToBuglyAction < Action
7
7
  def self.run(params)
8
- UI.message("The upload_dsym_to_bugly plugin is working!")
8
+ require 'json'
9
+ # fastlane will take care of reading in the parameter and fetching the environment variable:
10
+ UI.message "file path: #{params[:file_path]}"
11
+
12
+ json_file = 'upload_dsym_to_bugly_result.json'
13
+
14
+ begin
15
+ api_version = ''
16
+ if !params[:api_version].nil? && params[:api_version] > 0
17
+ api_version = " --form \"api_version=#{params[:api_version]}\" "
18
+ UI.message "api_version: #{api_version}"
19
+ end
20
+ rescue Exception => e
21
+ UI.message "error at checking api version, caused by #{e}"
22
+ end
23
+
24
+ begin
25
+ channel = ''
26
+ if !params[:channel].nil? && !params[:channel].empty?
27
+ channel = " --form \"channel=#{params[:channel]}\" "
28
+ UI.message "channel: #{channel}"
29
+ end
30
+ rescue Exception => e
31
+ UI.message "error at checking api version, caused by #{e}"
32
+ end
33
+
34
+ cmd = "curl -k \"https://api.bugly.qq.com/openapi/file/upload/symbol?app_key=#{params[:app_key]}&app_id=#{params[:app_id]}\"" + api_version + " --form \"app_id=#{params[:app_id]}\"" + " --form \"app_key=#{params[:app_key]}\"" + " --form \"symbolType=#{params[:symbol_type]}\"" + " --form \"bundleId=#{params[:bundle_id]}\"" + " --form \"productVersion=#{params[:product_version]}\"" + channel + " --form \"fileName=#{params[:file_name]}\"" + " --form \"file=@#{params[:file_path]}\"" + " -o " + json_file
35
+ sh(cmd)
36
+ obj = JSON.parse(File.read(json_file))
37
+ ret = obj['rtcode']
38
+ if ret == 0
39
+ UI.message "upload success"
40
+ else
41
+ UI.message "upload failed, result is #{obj}"
42
+ end
43
+ `rm upload_dsym_to_bugly_result.json`
9
44
  end
10
45
 
11
46
  def self.description
@@ -27,11 +62,6 @@ module Fastlane
27
62
 
28
63
  def self.available_options
29
64
  [
30
- # FastlaneCore::ConfigItem.new(key: :your_option,
31
- # env_name: "UPLOAD_DSYM_TO_BUGLY_YOUR_OPTION",
32
- # description: "A description of your option",
33
- # optional: false,
34
- # type: String)
35
65
  FastlaneCore::ConfigItem.new(key: :api_version,
36
66
  env_name: "FL_UPLOAD_DSYM_TO_BUGLY_API_VERSION",
37
67
  description: "api version for UploadDsymToBuglyAction",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UploadDsymToBugly
3
- VERSION = "0.2.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-upload_dsym_to_bugly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - liubo