fastlane-plugin-huawei_appgallery_connect 1.0.5 → 1.0.10
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/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb +101 -0
- data/lib/fastlane/plugin/huawei_appgallery_connect/helper/huawei_appgallery_connect_helper.rb +25 -4
- data/lib/fastlane/plugin/huawei_appgallery_connect/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4730eea2fe43d0c50a03cab93d475c48d373685456f0735de5d40bfef322944e
|
4
|
+
data.tar.gz: 49acfbc7cd1932ef5b02fa8412a0abf37caf0e7a50ca83bbc456e1a858bc005e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef179ee73d6b189ecd473f9284d7e69e9ba0c83be8c7ec85ce6fa4ccd46bafb18d092460cc6b384a88ae55d739589d6ea05aa1306a3752b2bdc3c57dd3f49881
|
7
|
+
data.tar.gz: 6d05974036fa6b42ad6a5270d4ce8c5ce395e2450209de88103c7debc65f8e024faadc4fda740f880cb22c3af52596d405d990805cc10b649d46ff6d1ac373a8
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/huawei_appgallery_connect_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class HuaweiAppgalleryConnectSubmitForReviewAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_secret])
|
9
|
+
|
10
|
+
if token.nil?
|
11
|
+
UI.message("Cannot retrieve token, please check your client ID and client secret")
|
12
|
+
else
|
13
|
+
|
14
|
+
Helper::HuaweiAppgalleryConnectHelper.submit_app_for_review(token, params)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.description
|
19
|
+
"Huawei AppGallery Connect Plugin"
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.authors
|
23
|
+
["Shreejan Shrestha"]
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.return_value
|
27
|
+
# If your method provides a return value, you can describe here what it does
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.details
|
31
|
+
# Optional:
|
32
|
+
"Fastlane plugin to upload Android app to Huawei AppGallery Connect"
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.available_options
|
36
|
+
[
|
37
|
+
FastlaneCore::ConfigItem.new(key: :client_id,
|
38
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_CLIENT_ID",
|
39
|
+
description: "Huawei AppGallery Connect Client ID",
|
40
|
+
optional: false,
|
41
|
+
type: String),
|
42
|
+
|
43
|
+
FastlaneCore::ConfigItem.new(key: :client_secret,
|
44
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_CLIENT_SECRET",
|
45
|
+
description: "Huawei AppGallery Connect Client Secret",
|
46
|
+
optional: false,
|
47
|
+
type: String),
|
48
|
+
|
49
|
+
FastlaneCore::ConfigItem.new(key: :app_id,
|
50
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_APP_ID",
|
51
|
+
description: "Huawei AppGallery Connect App ID",
|
52
|
+
optional: false,
|
53
|
+
type: String),
|
54
|
+
|
55
|
+
FastlaneCore::ConfigItem.new(key: :phase_wise_release,
|
56
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE",
|
57
|
+
description: "Phase wise release",
|
58
|
+
optional: true,
|
59
|
+
conflicting_options: [:release_time],
|
60
|
+
type: Boolean),
|
61
|
+
|
62
|
+
FastlaneCore::ConfigItem.new(key: :phase_release_start_time,
|
63
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_START_TIME",
|
64
|
+
description: "Start time of the validity period of the release by phase. The value is UTC time in the following format: yyyy-MM-dd 'T' HH:mm:ssZZ",
|
65
|
+
optional: true,
|
66
|
+
type: String),
|
67
|
+
|
68
|
+
FastlaneCore::ConfigItem.new(key: :phase_release_end_time,
|
69
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_END_TIME",
|
70
|
+
description: "End time of the validity period of the release by phase. The value is UTC time in the following format: yyyy-MM-dd 'T' HH:mm:ssZZ",
|
71
|
+
optional: true,
|
72
|
+
type: String),
|
73
|
+
|
74
|
+
FastlaneCore::ConfigItem.new(key: :phase_release_percent,
|
75
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_PERCENT",
|
76
|
+
description: "Percentage of the release by phase. The value must be accurate to two decimal places and does not contain the percent sign (%)",
|
77
|
+
optional: true,
|
78
|
+
type: String),
|
79
|
+
|
80
|
+
FastlaneCore::ConfigItem.new(key: :phase_release_description,
|
81
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_DESCRIPTION",
|
82
|
+
description: "Phase-based release description. (Max 500 characters)",
|
83
|
+
optional: true,
|
84
|
+
type: String),
|
85
|
+
|
86
|
+
FastlaneCore::ConfigItem.new(key: :release_time,
|
87
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_RELEASE_TIME",
|
88
|
+
description: "Release time in UTC format for app release on a specific date. The format is yyyy-MM-dd'T'HH:mm:ssZZ)",
|
89
|
+
optional: true,
|
90
|
+
conflicting_options: [:phase_wise_release],
|
91
|
+
type: String)
|
92
|
+
]
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.is_supported?(platform)
|
96
|
+
[:android].include?(platform)
|
97
|
+
true
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
data/lib/fastlane/plugin/huawei_appgallery_connect/helper/huawei_appgallery_connect_helper.rb
CHANGED
@@ -31,13 +31,17 @@ module Fastlane
|
|
31
31
|
request["client_id"] = client_id
|
32
32
|
request["Authorization"] = "Bearer #{token}"
|
33
33
|
response = http.request(request)
|
34
|
-
|
34
|
+
if !response.kind_of? Net::HTTPSuccess
|
35
|
+
UI.user_error!("Cannot obtain app info, please check API Token / Permissions (status code: #{response.code})")
|
36
|
+
return false
|
37
|
+
end
|
35
38
|
result_json = JSON.parse(response.body)
|
36
39
|
|
37
40
|
if result_json['ret']['code'] == 0
|
38
41
|
UI.success("Successfully getting app info")
|
39
42
|
return result_json['appInfo']
|
40
43
|
else
|
44
|
+
UI.user_error!(result_json)
|
41
45
|
UI.user_error!("Failed to get app info")
|
42
46
|
end
|
43
47
|
|
@@ -57,12 +61,16 @@ module Fastlane
|
|
57
61
|
request.body = {privacyPolicy: privacy_policy_url}.to_json
|
58
62
|
|
59
63
|
response = http.request(request)
|
60
|
-
|
64
|
+
if !response.kind_of? Net::HTTPSuccess
|
65
|
+
UI.user_error!("Cannot update app info, please check API Token / Permissions (status code: #{response.code})")
|
66
|
+
return false
|
67
|
+
end
|
61
68
|
result_json = JSON.parse(response.body)
|
62
69
|
|
63
70
|
if result_json['ret']['code'] == 0
|
64
71
|
UI.success("Successfully updated app info")
|
65
72
|
else
|
73
|
+
UI.user_error!(result_json)
|
66
74
|
UI.user_error!("Failed to update app info")
|
67
75
|
end
|
68
76
|
end
|
@@ -105,6 +113,10 @@ module Fastlane
|
|
105
113
|
request.set_form form_data, 'multipart/form-data'
|
106
114
|
|
107
115
|
result = http.request(request)
|
116
|
+
if !result.kind_of? Net::HTTPSuccess
|
117
|
+
UI.user_error!("Cannot upload app, please check API Token / Permissions (status code: #{result.code})")
|
118
|
+
return false
|
119
|
+
end
|
108
120
|
result_json = JSON.parse(result.body)
|
109
121
|
|
110
122
|
if result_json['result']['result_code'].to_i == 0
|
@@ -129,7 +141,10 @@ module Fastlane
|
|
129
141
|
|
130
142
|
request.body = data
|
131
143
|
response = http.request(request)
|
132
|
-
|
144
|
+
if !response.kind_of? Net::HTTPSuccess
|
145
|
+
UI.user_error!("Cannot save app info, please check API Token / Permissions (status code: #{response.code})")
|
146
|
+
return false
|
147
|
+
end
|
133
148
|
result_json = JSON.parse(response.body)
|
134
149
|
|
135
150
|
if result_json['ret']['code'] == 0
|
@@ -202,12 +217,18 @@ module Fastlane
|
|
202
217
|
|
203
218
|
response = http.request(request)
|
204
219
|
|
220
|
+
if !response.kind_of? Net::HTTPSuccess
|
221
|
+
UI.user_error!("Cannot submit app for review (status code: #{response.code}, body: #{response.body})")
|
222
|
+
return false
|
223
|
+
end
|
224
|
+
|
205
225
|
result_json = JSON.parse(response.body)
|
206
226
|
|
207
227
|
if result_json['ret']['code'] == 0
|
208
228
|
UI.success("Successfully submitted app for review")
|
209
229
|
else
|
210
|
-
UI.user_error!(
|
230
|
+
UI.user_error!(result_json)
|
231
|
+
UI.user_error!("Failed to submit app for review.")
|
211
232
|
end
|
212
233
|
|
213
234
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-huawei_appgallery_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shreejan Shrestha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/fastlane/plugin/huawei_appgallery_connect.rb
|
148
148
|
- lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_action.rb
|
149
149
|
- lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_get_app_info.rb
|
150
|
+
- lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb
|
150
151
|
- lib/fastlane/plugin/huawei_appgallery_connect/helper/huawei_appgallery_connect_helper.rb
|
151
152
|
- lib/fastlane/plugin/huawei_appgallery_connect/version.rb
|
152
153
|
homepage: https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
|