fastlane-plugin-upload_dsym_to_bugly 1.0.0 → 1.1.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: e5c6d8fb01161391981fb9bde20dea2336c107189dd84b16854bf00c33a632b2
4
- data.tar.gz: ed3378e92801987b5972afcc097956b7c7fb864f0e26af538bbbcc6e1e8fa927
3
+ metadata.gz: f2c02a47233bd9f60730b435c7fb47dfe4f299cf4604e4dcf08a2c78302ffe2e
4
+ data.tar.gz: 12ab864ed723d68a947eebce9fc94452666afa74b28b865c3052638081718e7e
5
5
  SHA512:
6
- metadata.gz: 177bde3c38855222dff3aa3ebef497041c486d57c7695dbb69c00a1e15cd239f23eebc0f4a0db2d119010665d0e089edf02c2fd27b59061e49cc60f0986df1f8
7
- data.tar.gz: 8d54f91666b357f88e83aa7c1d66abc767dcb980d84b4e4bd48c1a0361ec84198db351427c4009b0edb03428ae7243f4a284fd35bdd7831b3e27f0718139df6d
6
+ metadata.gz: 7da9f2eed269112425d7f13dc3fa683c6145f7f289cb7c3aa01b56d5515ad94ce8dc51bb30e3fb0d7b229df2784bcc5225d6ef4b8e3fcf4ccaf0241ff165de5c
7
+ data.tar.gz: 9bcd4098261b6555f8d6ef485f2b17389118459d3856ef949415267f44480ac62b9b015977a71b3ba634d83d7d2fabd2325345c1d943ad5fece4be2b37ee06fa
data/README.md CHANGED
@@ -6,34 +6,53 @@
6
6
 
7
7
  This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-upload_dsym_to_bugly`, add it to your project by running:
8
8
 
9
- ```bash
10
- fastlane add_plugin upload_dsym_to_bugly
9
+ ```shell
10
+ $ fastlane add_plugin upload_dsym_to_bugly
11
11
  ```
12
12
 
13
- ## About upload_dsym_to_bugly
14
-
15
- upload_dsym_to_bugly
16
-
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
13
+ add the following to your `fastfile`
14
+ ```ruby
15
+ lane :upload_dysm do
16
+ upload_dsym_to_bugly(
17
+ file_path: "<your dSYM.zip path>",
18
+ file_name: "<your dSYM.zip name>",
19
+ app_key: "<your app_key>",
20
+ app_id:"<your app_id>",
21
+ api_version: 1,
22
+ symbol_type: 2, # iOS => 2, Android => 1
23
+ bundle_id: '<your bundle id>',
24
+ product_version: `/usr/libexec/PlistBuddy -c \"print CFBundleShortVersionString\" \"<path/to/your/Info.plist>\"`,
25
+ )
26
+ end
27
+ ```
18
28
 
19
- ## Example
29
+ if you want to upload your ipa to bugly, add the following to your `fastfile`
30
+ ```ruby
31
+ lane :upload_ipa do
32
+ upload_app_to_bugly(
33
+ file_path:"<your *.ipa filepath>",
34
+ app_key:"<your app_key>",
35
+ app_id:"<your app_id>",
36
+ pid:"2",
37
+ title:"<title>",
38
+ desc:"<description>",
39
+ secret:"<secret>",
40
+ users:"<users>",
41
+ password:"<password>",
42
+ download_limit:download_limit
43
+ )
44
+ end
20
45
 
21
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
46
+ ```
22
47
 
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
48
+ ## About upload_dsym_to_bugly
24
49
 
25
- ## Run tests for this plugin
50
+ upload dSYM to bugly
26
51
 
27
- To run both the tests, and code style validation, run
52
+ ## Using _fastlane_ Plugins
28
53
 
29
- ```
30
- rake
31
- ```
54
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
32
55
 
33
- To automatically fix many of the styling issues, use
34
- ```
35
- rubocop -a
36
- ```
37
56
 
38
57
  ## Issues and Feedback
39
58
 
@@ -43,10 +62,6 @@ For any other issues and feedback about this plugin, please submit it to this re
43
62
 
44
63
  If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
45
64
 
46
- ## Using _fastlane_ Plugins
47
-
48
- For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
49
-
50
65
  ## About _fastlane_
51
66
 
52
67
  _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,186 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/upload_dsym_to_bugly_helper'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ module SharedValues
7
+ UPLOAD_APP_TO_BUGLY_DOWNLOAD_URL = :UPLOAD_APP_TO_BUGLY_DOWNLOAD_URL
8
+ end
9
+
10
+ # To share this integration with the other fastlane users:
11
+ # - Fork https://github.com/fastlane/fastlane/tree/master/fastlane
12
+ # - Clone the forked repository
13
+ # - Move this integration into lib/fastlane/actions
14
+ # - Commit, push and submit the pull request
15
+
16
+ class UploadAppToBuglyAction < Action
17
+ def self.run(params)
18
+ require 'json'
19
+ # fastlane will take care of reading in the parameter and fetching the environment variable:
20
+ UI.message "file path: #{params[:file_path]}"
21
+
22
+ json_file = 'upload_app_to_bugly_result.json'
23
+
24
+ begin
25
+ secret = ''
26
+ if !params[:secret].to_s.nil? && !params[:secret].empty?
27
+ secret = " -F \"secret=#{params[:secret]}\" "
28
+ UI.message "secret:#{secret}"
29
+ end
30
+ rescue Exception => e
31
+ UI.message "error at checking secret,caused by #{e}"
32
+ return
33
+ end
34
+
35
+ begin
36
+ users = ''
37
+ if !params[:users].nil? && !params[:users].empty?
38
+ users = " -F \"users=#{params[:users]}\" "
39
+ UI.message "users:#{users}"
40
+ end
41
+ rescue Exception => e
42
+ UI.message "error at checking users,caused by #{e}"
43
+ return
44
+ end
45
+
46
+ begin
47
+ password = ''
48
+ if !params[:password].nil? && !params[:password].empty?
49
+ password = " -F \"password=#{params[:password]}\" "
50
+ UI.message "password:#{password}"
51
+ end
52
+ rescue Exception => e
53
+ UI.message "error at checking password,caused by #{e}"
54
+ return
55
+ end
56
+
57
+ begin
58
+ download_limit = ''
59
+ if !params[:download_limit].nil? && params[:download_limit] > 0
60
+ download_limit = " -F \"download_limit=#{params[:download_limit]}\" "
61
+ UI.message "download_limit:#{download_limit}"
62
+ end
63
+ rescue Exception => e
64
+ UI.message "error at checking download_limit,caused by #{e}"
65
+ return
66
+ end
67
+
68
+ cmd = "curl --insecure -F \"file=@#{params[:file_path]}\" -F \"app_id=#{params[:app_id]}\" -F \"pid=#{params[:pid]}\" -F \"title=#{params[:title]}\" -F \"description=#{params[:desc]}\"" + secret + users + password + download_limit + " https://api.bugly.qq.com/beta/apiv1/exp?app_key=#{params[:app_key]} -o " + json_file
69
+ sh(cmd)
70
+ obj = JSON.parse(File.read(json_file))
71
+ ret = obj['rtcode']
72
+ if ret == 0
73
+ UI.message "upload success"
74
+ url = obj['data']['url']
75
+ Actions.lane_context[SharedValues::UPLOAD_APP_TO_BUGLY_DOWNLOAD_URL] = url
76
+ else
77
+ UI.message "upload failed,result is #{obj}"
78
+ end
79
+ end
80
+
81
+ #####################################################
82
+ # @!group Documentation
83
+ #####################################################
84
+
85
+ def self.description
86
+ 'A short description with <= 80 characters of what this action does'
87
+ end
88
+
89
+ def self.details
90
+ # Optional:
91
+ # this is your chance to provide a more detailed description of this action
92
+ 'You can use this action to do cool things...'
93
+ end
94
+
95
+ def self.available_options
96
+ # Define all options your action supports.
97
+
98
+ # Below a few examples
99
+ [
100
+ FastlaneCore::ConfigItem.new(key: :file_path,
101
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_FILE_PATH',
102
+ description: 'file path for UploadAppToBuglyAction',
103
+ is_string: true,
104
+ verify_block: proc do |value|
105
+ UI.user_error!("No file path for UploadAppToBuglyAction given, pass using `file_path: 'path'`") unless value && !value.empty?
106
+ UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
107
+ end),
108
+ FastlaneCore::ConfigItem.new(key: :app_key,
109
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_APP_KEY',
110
+ description: 'app key for UploadAppToBuglyAction',
111
+ is_string: true,
112
+ verify_block: proc do |value|
113
+ UI.user_error!("NO app_key for UploadAppToBuglyAction given, pass using `app_key: 'app_key'`") unless value && !value.empty?
114
+ end),
115
+ FastlaneCore::ConfigItem.new(key: :app_id,
116
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_APP_ID',
117
+ description: 'app id for UploadAppToBuglyAction',
118
+ is_string: true,
119
+ verify_block: proc do |value|
120
+ UI.user_error!("No app_id for UploadAppToBuglyAction given, pass using `app_id: 'app_id'`") unless value && !value.empty?
121
+ end),
122
+ FastlaneCore::ConfigItem.new(key: :pid,
123
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_PID',
124
+ description: 'pid for UploadToBuglyAction',
125
+ is_string: true,
126
+ verify_block: proc do |value|
127
+ UI.user_error!("No pid for UploadAppToBuglyAction given, pass using `pid: 'pid'`") unless value && !value.empty?
128
+ end),
129
+ FastlaneCore::ConfigItem.new(key: :title,
130
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_TITLE',
131
+ description: 'title for UploadAppToBuglyAction',
132
+ is_string: true,
133
+ default_value: 'title',
134
+ verify_block: proc do |value|
135
+ UI.user_error!("No title for UploadAppToBuglyAction given, pass using `title: 'title'`") unless value && !value.empty?
136
+ end),
137
+ FastlaneCore::ConfigItem.new(key: :desc,
138
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_DESC',
139
+ description: 'desc for UploadAppToBuglyAction',
140
+ is_string: true,
141
+ default_value: 'desc'),
142
+ FastlaneCore::ConfigItem.new(key: :secret,
143
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_DESCRIPTION',
144
+ description: 'secret for UploadAppToBuglyAction',
145
+ is_string: true,
146
+ default_value: ''),
147
+ FastlaneCore::ConfigItem.new(key: :users,
148
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_DESCRIPTION',
149
+ description: 'users for UploadAppToBuglyAction',
150
+ is_string: true,
151
+ default_value: ''),
152
+ FastlaneCore::ConfigItem.new(key: :password,
153
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_DESCRIPTION',
154
+ description: 'password for UploadAppToBuglyAction',
155
+ is_string: true,
156
+ default_value: ''),
157
+ FastlaneCore::ConfigItem.new(key: :download_limit,
158
+ env_name: 'FL_UPLOAD_APP_TO_BUGLY_DESCRIPTION',
159
+ description: 'download_limit for UploadAppToBuglyAction',
160
+ is_string: false, # true: verifies the input is a string, false: every kind of value
161
+ default_value: 10_000)
162
+ ]
163
+ end
164
+
165
+ def self.output
166
+ # Define the shared values you are going to provide
167
+ [
168
+ ['UPLOAD_APP_TO_BUGLY_DOWNLOAD_URL', 'download url']
169
+ ]
170
+ end
171
+
172
+ def self.return_value
173
+ # If you method provides a return value, you can describe here what it does
174
+ end
175
+
176
+ def self.authors
177
+ # So no one will ever forget your contribution to fastlane :) You are awesome btw!
178
+ ["liubo"]
179
+ end
180
+
181
+ def self.is_supported?(platform)
182
+ platform == :ios
183
+ end
184
+ end
185
+ end
186
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UploadDsymToBugly
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-upload_dsym_to_bugly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - liubo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-12 00:00:00.000000000 Z
11
+ date: 2019-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -146,6 +146,7 @@ files:
146
146
  - README.md
147
147
  - lib/fastlane/plugin/upload_dsym_to_bugly.rb
148
148
  - lib/fastlane/plugin/upload_dsym_to_bugly/actions/upload_dsym_to_bugly_action.rb
149
+ - lib/fastlane/plugin/upload_dsym_to_bugly/actions/upload_ipa_to_bugly_action.rb
149
150
  - lib/fastlane/plugin/upload_dsym_to_bugly/helper/upload_dsym_to_bugly_helper.rb
150
151
  - lib/fastlane/plugin/upload_dsym_to_bugly/version.rb
151
152
  homepage: https://github.com/srv7/fastlane-plugin-upload_dsym_to_bugly
@@ -168,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
169
  version: '0'
169
170
  requirements: []
170
171
  rubyforge_project:
171
- rubygems_version: 2.7.7
172
+ rubygems_version: 2.7.6
172
173
  signing_key:
173
174
  specification_version: 4
174
175
  summary: upload_dsym_to_bugly