lhj-tools 0.2.61 → 0.2.63
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 +4 -4
- data/lib/lhj/helper/app_version_info.rb +2 -1
- data/lib/lhj/helper/pgyer_helper.rb +14 -25
- data/lib/lhj/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77f66fd979d6fe1773bd9c603fda0dd2cbb1b3107267d64ded1360377e573b2f
|
|
4
|
+
data.tar.gz: 50d1e50e766fe708bde20971ab1235437514a3680abacc286ed2ca91d37eba57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dde586d855c8c511510922f81699041945fcb4efe834d786cbebbd52beee3440236db020568d38c906587eeddb62cf8760a6727c1cfbe2fc878dfa36c89fd88d
|
|
7
|
+
data.tar.gz: 4de47cd395f046a096215ff2b5fde89761ae19f2e03bc8c57ba5819924ae974e58e80cb22a7bc9d55f747153d88760768ea82b52a6e5f1d9b4224e26312c1f80
|
|
@@ -71,51 +71,40 @@ module Lhj
|
|
|
71
71
|
response = pgyer_client.post "#{API_HOST}/getCOSToken", request_params
|
|
72
72
|
info = response.body
|
|
73
73
|
|
|
74
|
-
if info[
|
|
75
|
-
UI.user_error!("Get token is failed, info: #{info}")
|
|
76
|
-
end
|
|
74
|
+
UI.user_error!("Get token is failed, info: #{info}") if info['code'] != 0
|
|
77
75
|
|
|
78
76
|
key = info['data']['key']
|
|
79
77
|
endpoint = info['data']['endpoint']
|
|
80
78
|
request_params = info['data']['params']
|
|
81
|
-
if key.nil? || endpoint.nil? || request_params.nil?
|
|
82
|
-
UI.user_error!('Get token is failed')
|
|
83
|
-
end
|
|
79
|
+
UI.user_error!('Get token is failed') if key.nil? || endpoint.nil? || request_params.nil?
|
|
84
80
|
request_params['file'] = Faraday::UploadIO.new(file, 'application/octet-stream')
|
|
85
81
|
|
|
86
82
|
response = pgyer_client.post endpoint, request_params
|
|
87
83
|
|
|
88
|
-
if response.status != 204
|
|
89
|
-
UI.user_error!("PGYER Plugin Upload Error: #{response.body}")
|
|
90
|
-
end
|
|
84
|
+
UI.user_error!("Upload Error: #{response.body}") if response.status != 204
|
|
91
85
|
|
|
92
|
-
@result =
|
|
86
|
+
@result = check_publish_status(pgyer_client, API_HOST, @api_key, key)
|
|
93
87
|
|
|
94
88
|
puts @result
|
|
95
89
|
Actions.sh('git restore ./', log: false) if File.exist?(File.expand_path('./.git'))
|
|
96
90
|
puts 'upload success'
|
|
97
91
|
end
|
|
98
92
|
|
|
99
|
-
def
|
|
93
|
+
def check_publish_status(client, api_host, api_key, build_key)
|
|
100
94
|
url = "#{api_host}/buildInfo"
|
|
101
|
-
|
|
102
|
-
response = client.post "#{api_host}/buildInfo", { :_api_key => api_key, :buildKey => buildKey }
|
|
95
|
+
response = client.post url, { _api_key: api_key, buildKey: build_key }
|
|
103
96
|
info = response.body
|
|
104
97
|
code = info['code']
|
|
105
|
-
if code
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
info["data"]["fastlaneAddedWholeVisitUrl"] = "https://wwww.xcxwo.com/#{shortUrl}"
|
|
112
|
-
UI.success "Upload success. Visit this URL to see: #{info["data"]["fastlaneAddedWholeVisitUrl"]}"
|
|
113
|
-
return info["data"]
|
|
114
|
-
elsif code == 1246 || code == 1247
|
|
98
|
+
if code.zero?
|
|
99
|
+
short_url = info['data']['buildShortcutUrl']
|
|
100
|
+
short_url = info['data']['buildKey'] if short_url.nil? || short_url == ''
|
|
101
|
+
info['data']['fastlaneAddedWholeVisitUrl'] = "https://wwww.xcxwo.com/#{short_url}"
|
|
102
|
+
info
|
|
103
|
+
elsif [1246, 1247].include?(code)
|
|
115
104
|
sleep 3
|
|
116
|
-
|
|
105
|
+
check_publish_status(client, api_host, api_key, build_key)
|
|
117
106
|
else
|
|
118
|
-
UI.user_error!("PGYER Plugin Published Error: #{info} buildKey: #{
|
|
107
|
+
UI.user_error!("PGYER Plugin Published Error: #{info} buildKey: #{build_key}")
|
|
119
108
|
end
|
|
120
109
|
end
|
|
121
110
|
|
data/lib/lhj/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lhj-tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.63
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- lihaijian
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-09-
|
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: xcodeproj
|