fastlane-plugin-pgyer_cl 0.1.1 → 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: b7d301320bb3d3ee39be84155ec6c1549999784a1a42acb9bda8cadd7414c3c0
4
- data.tar.gz: c8b305cd66392217fd9c5a2dd3ebe3731bb17c75e0db281e4dc31d6fde05d9b8
3
+ metadata.gz: 1da5186e8f48da4ba4625a186f99e08091a0eda6f87f1cbd4737736bd58404d6
4
+ data.tar.gz: 2edc6099540f21ec756fa08ed421f3821aa909577f4170c0eca3c797e177bd1e
5
5
  SHA512:
6
- metadata.gz: 6516aff7fe32e20f46073ad5cfeb042f228001220c12c7014569f25503264ceb84d000e476a85c268931cc04396798391bc57d5873bdf223d09be3ad659d6f4a
7
- data.tar.gz: 9989b23a01fb253342ed67f08377bdf8be872a0acb4a44ad7d66835921b43e186d81d42c8795fafa053009fa8cba4e5670d8bac361e828f57b791c4f4df548ff
6
+ metadata.gz: 2fc2078ff69683ec2c62b84326179fd1add66cb4597c1028af176aa744f8070a9d2d21260cae11752937aa72be47b202b443451eb7fcb0a828bf454413d5a47a
7
+ data.tar.gz: cce9450c41621bedb7a1dac9703c356de1185707c55be0a0e72733b5816fc9f455c9e63418515e39894e10f2122b83db74edd1d74fb2508a1b4dd8aa398b7808
@@ -6,7 +6,7 @@ module Fastlane
6
6
  module Actions
7
7
  class PgyerClAction < Action
8
8
  def self.run(params)
9
- UI.message("The pgyer_cl plugin is working!")
9
+ UI.message("pgyer_cl开始工作!")
10
10
 
11
11
  api_host = "https://www.pgyer.com/apiv2/app/upload"
12
12
  api_key = params[:api_key]
@@ -40,10 +40,11 @@ module Fastlane
40
40
  ].detect { |e| !e.to_s.empty? }
41
41
 
42
42
  if build_file.nil?
43
- UI.user_error!("You have to provide a build file")
43
+ UI.user_error!("您需要配置一个上传的文件")
44
+ return
44
45
  end
45
46
 
46
- UI.message "build_file: #{build_file}"
47
+ UI.message "配置上传文件: #{build_file}"
47
48
 
48
49
  password = params[:password]
49
50
  if password.nil?
@@ -83,17 +84,17 @@ module Fastlane
83
84
  'file' => Faraday::UploadIO.new(build_file, 'application/octet-stream')
84
85
  }
85
86
 
86
- UI.message "Start upload #{build_file} to pgyer..."
87
+ UI.message "开始上传文件 #{build_file} 到蒲公英..."
87
88
 
88
89
  response = pgyer_client.post api_host, params
89
90
  info = response.body
90
91
 
91
92
  if info['code'] != 0
92
- UI.user_error!("PGYER Plugin Error: #{info['message']}")
93
+ UI.user_error!("蒲公英组件错误信息: #{info['message']}")
93
94
  return
95
+ else
96
+ UI.success "蒲公英上传成功. 详见: https://www.pgyer.com/#{info['data']['buildShortcutUrl']}"
94
97
  end
95
-
96
- UI.success "Upload success. Visit this URL to see: https://www.pgyer.com/#{info['data']['buildShortcutUrl']}"
97
98
  end
98
99
 
99
100
  appType = "Android";
@@ -117,9 +118,11 @@ module Fastlane
117
118
  if channel_shortcut.nil?
118
119
  appUrl = "https://www.pgyer.com/#{info['data']['buildShortcutUrl']}"
119
120
  end
121
+ else
120
122
  end
121
123
 
122
124
  unless fs_access_token.nil?
125
+ UI.message("配置飞书参数")
123
126
 
124
127
  config = {
125
128
  "wide_screen_mode": false
@@ -169,6 +172,8 @@ module Fastlane
169
172
  }
170
173
  }
171
174
 
175
+ UI.message("发送飞书消息")
176
+
172
177
  message_client = Faraday.new(nil, conn_options) do |c|
173
178
  c.request :json
174
179
  c.request :url_encoded
@@ -179,11 +184,14 @@ module Fastlane
179
184
  response = message_client.post message_post, params
180
185
  message_info = response.body
181
186
 
182
- if message_info['code'] != 0
183
- UI.error('feishu error message: ' + "#{message_info['code']}" + '----' + message_info["msg"])
187
+ if message_info['StatusCode'] != 0
188
+ UI.error("飞书消息发送失败: #{message_info["StatusMessage"]}")
189
+ else
190
+ UI.success('发送飞书消息成功');
184
191
  end
185
192
  end
186
- return
193
+
194
+ UI.message('pgyer_cl工作结束!')
187
195
  end
188
196
 
189
197
  def self.description
@@ -208,12 +216,12 @@ module Fastlane
208
216
  FastlaneCore::ConfigItem.new(key: :api_key,
209
217
  env_name: "PGYER_API_KEY",
210
218
  description: "api_key in your pgyer account",
211
- optional: true,
219
+ optional: false,
212
220
  type: String),
213
221
  FastlaneCore::ConfigItem.new(key: :user_key,
214
222
  env_name: "PGYER_USER_KEY",
215
223
  description: "user_key in your pgyer account",
216
- optional: true,
224
+ optional: false,
217
225
  type: String),
218
226
  FastlaneCore::ConfigItem.new(key: :apk,
219
227
  env_name: "PGYER_APK",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module PgyerCl
3
- VERSION = "0.1.1"
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-pgyer_cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - chenlei