fastlane-plugin-upload_dsym_to_bugly 0.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18388202b1fa50ea78fbac2ed0d2dd59071fbe67fb6cdf36dd1f3d2350aeb9c2
4
- data.tar.gz: 1b99b735d5b5ff70750387881d066e2a00a9cc0026a8c3af6fcefccc1c5e739a
3
+ metadata.gz: 65de6ddc5662f5007981a2d2278f2b76202c31f02cc81fbecc63fdad691342fa
4
+ data.tar.gz: 4aacea3dc9ec749c160b0f507d5f2c34e271477e89a22456c408141ab7826693
5
5
  SHA512:
6
- metadata.gz: d3449496b295f0b2df771d3dcc2735e518732394edd18acb9ab3cd4b2aa9cc8705a03c829a16e6d6c92f82ed35b339fe1fe169ec3bdf7c4c9c949828d7e1c5db
7
- data.tar.gz: 0bd70a22d68dcc6ef59f0b61cf205ee8757ea3e6adb57cc64b067d40f342173c84d2ec4c05514c2a929c4a56d05470e11540ad9cc7c7f3bd9f77e21c97abb502
6
+ metadata.gz: d4668daecd5ad5bd67bf87a4de8b50153beb44b59a85ac4cacd8453ce3d1d866ede2b123fec4be62daf4d2ebd5df68d17ba74c4daa44e87f74472433ddd5145c
7
+ data.tar.gz: c07121b824e52773f0b74e863dee3df2b1a026743296c948d07e59653028506b121d17a85a0c86766a3a303d8194519040cab5075f4f505deb3c73fa99b0e7a9
data/README.md CHANGED
@@ -2,38 +2,43 @@
2
2
 
3
3
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-upload_dsym_to_bugly)
4
4
 
5
- ## Getting Started
6
5
 
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:
6
+ ## Note
7
+ 2021 年 6 月 28 日 开始,bugly 不再支持使用 openApi 的方式上传符号表,需要使用官方提供的命令行上传工具进行上传。
8
+ 本插件当前使用的工具版本为:__3.3.4__
8
9
 
9
- ```bash
10
- fastlane add_plugin upload_dsym_to_bugly
11
- ```
12
-
13
- ## About upload_dsym_to_bugly
10
+ 另外去除了上传 ipa 到 bugly 的 action。
14
11
 
15
- upload_dsym_to_bugly
12
+ ## Getting Started
16
13
 
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.
14
+ 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:
18
15
 
19
- ## Example
16
+ ```shell
17
+ $ fastlane add_plugin upload_dsym_to_bugly
18
+ ```
20
19
 
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`.
20
+ add the following to your `fastfile`
21
+ ```ruby
22
+ lane :upload_dysm do
23
+ upload_dsym_to_bugly(
24
+ file_path: "<path/to/your/x.app.dSYM.zip",
25
+ app_key: "<your app_key>",
26
+ app_id:"<your app_id>",
27
+ bundle_id: '<your bundle id>',
28
+ version: get_version_number,
29
+ raise_if_error: false
30
+ )
31
+ end
32
+ ```
22
33
 
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)
34
+ ## About upload_dsym_to_bugly
24
35
 
25
- ## Run tests for this plugin
36
+ upload dSYM to bugly
26
37
 
27
- To run both the tests, and code style validation, run
38
+ ## Using _fastlane_ Plugins
28
39
 
29
- ```
30
- rake
31
- ```
40
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
32
41
 
33
- To automatically fix many of the styling issues, use
34
- ```
35
- rubocop -a
36
- ```
37
42
 
38
43
  ## Issues and Feedback
39
44
 
@@ -43,10 +48,6 @@ For any other issues and feedback about this plugin, please submit it to this re
43
48
 
44
49
  If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
45
50
 
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
51
  ## About _fastlane_
51
52
 
52
53
  _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).
@@ -1,11 +1,58 @@
1
- require 'fastlane/action'
2
- require_relative '../helper/upload_dsym_to_bugly_helper'
1
+ require "fastlane/action"
2
+ require_relative "../helper/upload_dsym_to_bugly_helper"
3
+ require 'fileutils'
3
4
 
4
5
  module Fastlane
5
6
  module Actions
7
+ module SharedValues
8
+ UPLOAD_DSYM_TO_BUGLY_RESULT = :UPLOAD_DSYM_TO_BUGLY_RESULT
9
+ end
6
10
  class UploadDsymToBuglyAction < Action
7
11
  def self.run(params)
8
- UI.message("The upload_dsym_to_bugly plugin is working!")
12
+
13
+ jar_path = File.expand_path('../../jars/buglyqq-upload-symbol-3.3.4.jar', __FILE__)
14
+ UI.message "jar path: #{jar_path}"
15
+
16
+ file_path = File.expand_path("#{params[:file_path]}")
17
+ UI.message "file path: #{file_path}"
18
+
19
+ unzip_path = File.expand_path(".upload_dsym_to_bugly_tmp", "#{File.dirname("#{file_path}")}")
20
+ UI.message "unzip path: #{unzip_path}"
21
+
22
+ if Dir.exist?(unzip_path)
23
+ FileUtils.rm_r(unzip_path, force: true)
24
+ end
25
+
26
+ if !Dir.glob(file_path).empty?
27
+ sh("unzip -o #{file_path} -d #{unzip_path}")
28
+ else
29
+ UI.message "dSYM zip File don't exist"
30
+ Actions.lane_context[SharedValues::UPLOAD_DSYM_TO_BUGLY_RESULT] = false
31
+ raise if params[:raise_if_error]
32
+ end
33
+ cmd = "java -jar #{jar_path} -appid #{params[:app_id]} -appkey #{params[:app_key]} -bundleid #{params[:bundle_id]} -version #{params[:version]} -platform #{params[:platform]} -inputSymbol #{unzip_path}"
34
+
35
+ log_file = "dSYM_upload_result.log"
36
+
37
+ begin
38
+ sh("#{cmd} > #{log_file}")
39
+ last_line = sh("tail -n 1 #{log_file}")
40
+
41
+ success = last_line.include?("retCode: 200") and last_line.include?("\"msg\":\"success\"")
42
+ if success
43
+ UI.message "dSYM upload successfully 🎉 "
44
+ Actions.lane_context[SharedValues::UPLOAD_DSYM_TO_BUGLY_RESULT] = true
45
+ else
46
+ UI.message "dSYM upload failed: #{last_line}"
47
+ Actions.lane_context[SharedValues::UPLOAD_DSYM_TO_BUGLY_RESULT] = false
48
+ raise if params[:raise_if_error]
49
+ end
50
+
51
+ rescue => exception
52
+ UI.message "dSYM upload failed, See log output above"
53
+ Actions.lane_context[SharedValues::UPLOAD_DSYM_TO_BUGLY_RESULT] = false
54
+ raise if params[:raise_if_error]
55
+ end
9
56
  end
10
57
 
11
58
  def self.description
@@ -27,70 +74,62 @@ module Fastlane
27
74
 
28
75
  def self.available_options
29
76
  [
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
- FastlaneCore::ConfigItem.new(key: :api_version,
36
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_API_VERSION",
37
- description: "api version for UploadDsymToBuglyAction",
38
- is_string: false,
39
- default_value: 1),
40
77
  FastlaneCore::ConfigItem.new(key: :app_id,
41
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_APP_ID",
42
- description: "app id for UploadDsymToBuglyAction",
43
- is_string: true,
44
- verify_block: proc do |value|
45
- UI.user_error!("No APP id for UploadDsymToBuglyAction given, pass using `app_id: 'app_id'`") unless (value and not value.empty?)
46
- end),
78
+ env_name: "FL_UPLOAD_DSYM_TO_BUGLY_APP_ID",
79
+ description: "app id",
80
+ is_string: true,
81
+ verify_block: proc do |value|
82
+ UI.user_error!("No APP id for UploadDsymToBuglyAction given, pass using `app_id: 'app_id'`") unless (value and not value.empty?)
83
+ end),
47
84
  FastlaneCore::ConfigItem.new(key: :app_key,
48
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_APP_KEY",
49
- description: "app key for UploadDsymToBuglyAction",
50
- is_string: true,
51
- verify_block: proc do |value|
52
- UI.user_error!("No APP key for UploadDsymToBuglyAction given, pass using `api_key: 'app_key'`") unless (value and not value.empty?)
53
- end),
54
- FastlaneCore::ConfigItem.new(key: :symbol_type,
55
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_SYMBOL_TYPE",
56
- description: "symbol type for UploadDsymToBuglyAction",
57
- is_string: false,
58
- verify_block: proc do |value|
59
- UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `symbol_type: 'symbol_type'`") unless (value and not value.to_s.empty?)
60
- end),
85
+ env_name: "FL_UPLOAD_DSYM_TO_BUGLY_APP_KEY",
86
+ description: "app key",
87
+ is_string: true,
88
+ verify_block: proc do |value|
89
+ UI.user_error!("No APP key for UploadDsymToBuglyAction given, pass using `api_key: 'app_key'`") unless (value and not value.empty?)
90
+ end),
61
91
  FastlaneCore::ConfigItem.new(key: :bundle_id,
62
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_BUNDLE_ID",
63
- description: "bundle id for UploadDsymToBuglyAction",
64
- is_string: true,
65
- verify_block: proc do |value|
66
- UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `bundle_id: 'bundle_id'`") unless (value and not value.empty?)
67
- end),
68
- FastlaneCore::ConfigItem.new(key: :product_version,
69
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_PRODEUCT_VERSION",
70
- description: "product version for UploadDsymToBuglyAction",
71
- is_string: true,
72
- verify_block: proc do |value|
73
- UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `product_version: 'product_version'`") unless (value and not value.empty?)
74
- end),
75
- FastlaneCore::ConfigItem.new(key: :channel,
76
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_CHANNEL",
77
- description: "channel for UploadDsymToBuglyAction",
78
- is_string: true,
79
- default_value: "fastlane"),
80
- FastlaneCore::ConfigItem.new(key: :file_name,
81
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_FILE_NAME",
82
- description: "file name for UploadDsymToBuglyAction",
83
- is_string: true,
84
- verify_block: proc do |value|
85
- UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `file_name: 'file_name'`") unless (value and not value.empty?)
86
- end),
92
+ env_name: "FL_UPLOAD_DSYM_TO_BUGLY_BUNDLE_ID",
93
+ description: "bundle id",
94
+ is_string: true,
95
+ verify_block: proc do |value|
96
+ UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `bundle_id: 'bundle_id'`") unless (value and not value.empty?)
97
+ end),
98
+ FastlaneCore::ConfigItem.new(key: :version,
99
+ env_name: "FL_UPLOAD_DSYM_TO_BUGLY_VERSION",
100
+ description: "app version",
101
+ is_string: true,
102
+ verify_block: proc do |value|
103
+ UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `version: 'version'`") unless (value and not value.empty?)
104
+ end),
87
105
  FastlaneCore::ConfigItem.new(key: :file_path,
88
- env_name: "FL_UPLOAD_DSYM_TO_BUGLY_FILE",
89
- description: "file for UploadDsymToBuglyAction",
90
- is_string: true,
91
- verify_block: proc do |value|
92
- UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `file_path: 'file_path'`") unless (value and not value.empty?)
93
- end)
106
+ env_name: "FL_UPLOAD_DSYM_TO_BUGLY_FILE",
107
+ description: "file path",
108
+ is_string: true,
109
+ verify_block: proc do |value|
110
+ UI.user_error!("No symbol type for UploadDsymToBuglyAction given, pass using `file_path: 'file_path'`") unless (value and not value.empty?)
111
+ end),
112
+ FastlaneCore::ConfigItem.new(key: :platform,
113
+ env_name: "FL_UPLOAD_DSYM_TO_BUGLY_FILE",
114
+ description: "platform",
115
+ is_string: true,
116
+ default_value: "IOS",
117
+ verify_block: proc do |value|
118
+ UI.user_error!("platform value error, available values: IOS, Android") unless (value == "IOS" or value == "Android")
119
+ end),
120
+ FastlaneCore::ConfigItem.new(key: :raise_if_error,
121
+ env_name: "FL_UPLOAD_DSYM_TO_BUGLY_RAISE_IF_ERROR",
122
+ description: "Raises an error if fails, so you can fail CI/CD jobs if necessary \(true/false)",
123
+ default_value: true,
124
+ is_string: false,
125
+ type: Boolean,
126
+ optional: false)
127
+ ]
128
+ end
129
+
130
+ def self.output
131
+ [
132
+ ["UPLOAD_DSYM_TO_BUGLY_RESULT", "upload result"],
94
133
  ]
95
134
  end
96
135
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UploadDsymToBugly
3
- VERSION = "0.2.0"
3
+ VERSION = "2.0.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: 0.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - liubo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-12 00:00:00.000000000 Z
11
+ date: 2021-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 2.108.0
139
- description:
139
+ description:
140
140
  email: liubo004@126.com
141
141
  executables: []
142
142
  extensions: []
@@ -147,12 +147,13 @@ files:
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
149
  - lib/fastlane/plugin/upload_dsym_to_bugly/helper/upload_dsym_to_bugly_helper.rb
150
+ - lib/fastlane/plugin/upload_dsym_to_bugly/jars/buglyqq-upload-symbol-3.3.4.jar
150
151
  - lib/fastlane/plugin/upload_dsym_to_bugly/version.rb
151
152
  homepage: https://github.com/srv7/fastlane-plugin-upload_dsym_to_bugly
152
153
  licenses:
153
154
  - MIT
154
155
  metadata: {}
155
- post_install_message:
156
+ post_install_message:
156
157
  rdoc_options: []
157
158
  require_paths:
158
159
  - lib
@@ -167,9 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
170
  requirements: []
170
- rubyforge_project:
171
- rubygems_version: 2.7.7
172
- signing_key:
171
+ rubygems_version: 3.1.2
172
+ signing_key:
173
173
  specification_version: 4
174
174
  summary: upload_dsym_to_bugly
175
175
  test_files: []