fastlane-plugin-huawei_appgallery_connect 1.0.9 → 1.0.14
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/README.md +54 -25
- data/lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_action.rb +7 -1
- data/lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb +7 -1
- data/lib/fastlane/plugin/huawei_appgallery_connect/helper/huawei_appgallery_connect_helper.rb +16 -3
- data/lib/fastlane/plugin/huawei_appgallery_connect/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: 7b26badca5c4e5028b8e90d24bdf2b300539f369b468ad182149c94bde47c406
|
4
|
+
data.tar.gz: 81b7075c7cc3f4bbfdc541e9cb82baad9636056b7773e0c5932ba4dd083bf3e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df7fcb9ba89d6708ea7c013e5f435935f9e608f8a8e8908fedb7016d1dd8b99c843707268786ad6638aa42b66ce54e68bea474046ff0e22fcb89d7c414c861fb
|
7
|
+
data.tar.gz: e50ad0fdbfd1933f26377752558d9cb0d1294c7ff6c99dec928c1d01fa39e4a5a366cbb78bc3e291fa4eb746947efb2f500da6cca95ece979565017ea0ae694f
|
data/README.md
CHANGED
@@ -12,41 +12,70 @@ fastlane add_plugin huawei_appgallery_connect
|
|
12
12
|
|
13
13
|
## About huawei_appgallery_connect
|
14
14
|
|
15
|
-
Huawei AppGallery Connect Plugin
|
15
|
+
Huawei AppGallery Connect Plugin can be used to upload Android application on the Huawei App Gallery using fastlane.
|
16
16
|
|
17
|
-
|
17
|
+
## Usage
|
18
18
|
|
19
|
-
|
20
|
-
|
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`.
|
22
|
-
|
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)
|
24
|
-
|
25
|
-
## Run tests for this plugin
|
26
|
-
|
27
|
-
To run both the tests, and code style validation, run
|
19
|
+
To get started you will need the client id, client Secret & app ID which can be obtained from your Huawei AppGallery Connect account.
|
28
20
|
|
29
21
|
```
|
30
|
-
|
22
|
+
huawei_appgallery_connect(
|
23
|
+
client_id: "<CLIENT_ID>",
|
24
|
+
client_secret: "<CLIENT_SECRET>",
|
25
|
+
app_id: "<APP_ID>",
|
26
|
+
apk_path: "<APK_PATH>"
|
27
|
+
|
28
|
+
# Optional, Parameter beyond this are optional
|
29
|
+
|
30
|
+
# if you're uploading aab instead of apk, specify is_aab to true and specify path to aab file on apk_path
|
31
|
+
is_aab: true
|
32
|
+
|
33
|
+
submit_for_review: false,
|
34
|
+
|
35
|
+
privacy_policy_url: "https://example.com",
|
36
|
+
changelog_path: "<PATH_TO_CHANGELOG_FILE>",
|
37
|
+
|
38
|
+
# release time to release app on specific date
|
39
|
+
release_time: "2019-12-25T07:05:15+0000",
|
40
|
+
|
41
|
+
# For phase wise release: set these parameters
|
42
|
+
phase_wise_release: true,
|
43
|
+
phase_release_start_time: "2019-12-25T07:05:15+0000",
|
44
|
+
phase_release_end_time: "2019-12-28T07:05:15+0000",
|
45
|
+
phase_release_percent: "10.00",
|
46
|
+
phase_release_description: "<DESCRIPTION>"
|
47
|
+
)
|
31
48
|
```
|
32
49
|
|
33
|
-
|
34
|
-
```
|
35
|
-
rubocop -a
|
36
|
-
```
|
50
|
+
The following action can be used to submit the app for review if submit_for_review was set to false during the upload of apk
|
37
51
|
|
38
|
-
|
39
|
-
|
40
|
-
|
52
|
+
```
|
53
|
+
huawei_appgallery_connect_submit_for_review(
|
54
|
+
client_id: "<CLIENT_ID>",
|
55
|
+
client_secret: "<CLIENT_SECRET>",
|
56
|
+
app_id: "<APP_ID>",
|
41
57
|
|
42
|
-
## Troubleshooting
|
43
58
|
|
44
|
-
|
59
|
+
# Optional, Parameter beyond this are optional
|
45
60
|
|
46
|
-
|
61
|
+
# release time to release app on specific date
|
62
|
+
release_time: "2019-12-25T07:05:15+0000",
|
47
63
|
|
48
|
-
For
|
64
|
+
# For phase wise release: set these parameters
|
65
|
+
phase_wise_release: true,
|
66
|
+
phase_release_start_time: "2019-12-25T07:05:15+0000",
|
67
|
+
phase_release_end_time: "2019-12-28T07:05:15+0000",
|
68
|
+
phase_release_percent: "10.00",
|
69
|
+
phase_release_description: "<DESCRIPTION>"
|
70
|
+
)
|
71
|
+
```
|
72
|
+
You can also retreive app info by making use of the following action
|
49
73
|
|
50
|
-
|
74
|
+
```
|
75
|
+
huawei_appgallery_connect_get_app_info(
|
76
|
+
client_id: "<CLIENT_ID>",
|
77
|
+
client_secret: "<CLIENT_SECRET>",
|
78
|
+
app_id: "<APP_ID>"
|
79
|
+
)
|
51
80
|
|
52
|
-
|
81
|
+
```
|
data/lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_action.rb
CHANGED
@@ -15,7 +15,7 @@ module Fastlane
|
|
15
15
|
Helper::HuaweiAppgalleryConnectHelper.update_appinfo(params[:client_id], token, params[:app_id], params[:privacy_policy_url])
|
16
16
|
end
|
17
17
|
|
18
|
-
upload_app = Helper::HuaweiAppgalleryConnectHelper.upload_app(token, params[:client_id], params[:app_id], params[:apk_path])
|
18
|
+
upload_app = Helper::HuaweiAppgalleryConnectHelper.upload_app(token, params[:client_id], params[:app_id], params[:apk_path], params[:is_aab])
|
19
19
|
|
20
20
|
if upload_app && params[:submit_for_review] != false
|
21
21
|
Helper::HuaweiAppgalleryConnectHelper.submit_app_for_review(token, params)
|
@@ -67,6 +67,12 @@ module Fastlane
|
|
67
67
|
optional: false,
|
68
68
|
type: String),
|
69
69
|
|
70
|
+
FastlaneCore::ConfigItem.new(key: :is_aab,
|
71
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_IS_AAB",
|
72
|
+
description: "Specify this to be true if you're uploading aab instead of apk",
|
73
|
+
optional: true,
|
74
|
+
type: Boolean),
|
75
|
+
|
70
76
|
FastlaneCore::ConfigItem.new(key: :changelog_path,
|
71
77
|
env_name: "HUAWEI_APPGALLERY_CONNECT_CHANGELOG_PATH",
|
72
78
|
description: "Path to Changelog file (Default empty)",
|
@@ -3,7 +3,7 @@ require_relative '../helper/huawei_appgallery_connect_helper'
|
|
3
3
|
|
4
4
|
module Fastlane
|
5
5
|
module Actions
|
6
|
-
class
|
6
|
+
class HuaweiAppgalleryConnectSubmitForReviewAction < Action
|
7
7
|
def self.run(params)
|
8
8
|
token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_secret])
|
9
9
|
|
@@ -88,6 +88,12 @@ module Fastlane
|
|
88
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
89
|
optional: true,
|
90
90
|
conflicting_options: [:phase_wise_release],
|
91
|
+
type: String),
|
92
|
+
|
93
|
+
FastlaneCore::ConfigItem.new(key: :changelog_path,
|
94
|
+
env_name: "HUAWEI_APPGALLERY_CONNECT_CHANGELOG_PATH",
|
95
|
+
description: "Path to Changelog file (Default empty)",
|
96
|
+
optional: true,
|
91
97
|
type: String)
|
92
98
|
]
|
93
99
|
end
|
data/lib/fastlane/plugin/huawei_appgallery_connect/helper/huawei_appgallery_connect_helper.rb
CHANGED
@@ -76,10 +76,16 @@ module Fastlane
|
|
76
76
|
end
|
77
77
|
|
78
78
|
|
79
|
-
def self.upload_app(token, client_id, app_id, apk_path)
|
79
|
+
def self.upload_app(token, client_id, app_id, apk_path, is_aab)
|
80
80
|
UI.message("Fetching upload URL")
|
81
81
|
|
82
|
-
|
82
|
+
if(is_aab)
|
83
|
+
uri = URI.parse("https://connect-api.cloud.huawei.com/api/publish/v2/upload-url?appId=#{app_id}&suffix=aab")
|
84
|
+
upload_filename = "release.aab"
|
85
|
+
else
|
86
|
+
uri = URI.parse("https://connect-api.cloud.huawei.com/api/publish/v2/upload-url?appId=#{app_id}&suffix=apk")
|
87
|
+
upload_filename = "release.apk"
|
88
|
+
end
|
83
89
|
|
84
90
|
http = Net::HTTP.new(uri.host, uri.port)
|
85
91
|
http.use_ssl = true
|
@@ -130,10 +136,11 @@ module Fastlane
|
|
130
136
|
request = Net::HTTP::Put.new(uri.request_uri)
|
131
137
|
request["client_id"] = client_id
|
132
138
|
request["Authorization"] = "Bearer #{token}"
|
139
|
+
request['Content-Type'] = "application/json"
|
133
140
|
|
134
141
|
data = {fileType: 5, files: [{
|
135
142
|
|
136
|
-
fileName:
|
143
|
+
fileName: upload_filename,
|
137
144
|
fileDestUrl: result_json['result']['UploadFileRsp']['fileInfoList'][0]['fileDestUlr'],
|
138
145
|
size: result_json['result']['UploadFileRsp']['fileInfoList'][0]['size'].to_s
|
139
146
|
|
@@ -226,6 +233,11 @@ module Fastlane
|
|
226
233
|
|
227
234
|
if result_json['ret']['code'] == 0
|
228
235
|
UI.success("Successfully submitted app for review")
|
236
|
+
elsif result_json['ret']['code'] == 204144660 && result_json['ret']['msg'].include?("It may take 2-5 minutes")
|
237
|
+
UI.important(result_json)
|
238
|
+
UI.important("Build is currently processing, waiting for 2 minutes before submitting again...")
|
239
|
+
sleep(120)
|
240
|
+
self.submit_app_for_review(token, params)
|
229
241
|
else
|
230
242
|
UI.user_error!(result_json)
|
231
243
|
UI.user_error!("Failed to submit app for review.")
|
@@ -235,3 +247,4 @@ module Fastlane
|
|
235
247
|
end
|
236
248
|
end
|
237
249
|
end
|
250
|
+
|
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.14
|
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-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|