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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1da5186e8f48da4ba4625a186f99e08091a0eda6f87f1cbd4737736bd58404d6
|
4
|
+
data.tar.gz: 2edc6099540f21ec756fa08ed421f3821aa909577f4170c0eca3c797e177bd1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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("
|
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!("
|
43
|
+
UI.user_error!("您需要配置一个上传的文件")
|
44
|
+
return
|
44
45
|
end
|
45
46
|
|
46
|
-
UI.message "
|
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 "
|
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!("
|
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['
|
183
|
-
UI.error(
|
187
|
+
if message_info['StatusCode'] != 0
|
188
|
+
UI.error("飞书消息发送失败: #{message_info["StatusMessage"]}")
|
189
|
+
else
|
190
|
+
UI.success('发送飞书消息成功');
|
184
191
|
end
|
185
192
|
end
|
186
|
-
|
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:
|
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:
|
224
|
+
optional: false,
|
217
225
|
type: String),
|
218
226
|
FastlaneCore::ConfigItem.new(key: :apk,
|
219
227
|
env_name: "PGYER_APK",
|