fastlane-plugin-huawei_appgallery_connect 1.0.8 → 1.0.13
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 +51 -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 +107 -0
- data/lib/fastlane/plugin/huawei_appgallery_connect/helper/huawei_appgallery_connect_helper.rb +11 -3
- 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: 02d57156fc8d0f2a570e0ebe61f2b051e88b074ef38d423ee9f3163a4096f8b2
|
4
|
+
data.tar.gz: 7f4d0f4d95586a6451771de0ba7ed0345096416f1974ac6fdfe3dcec9a172244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6f10f39d639c5990e418bfc63a9cf923386c53fef41b6a8846172acc30951e91c820ff13a2a072f3cfa21fda41c7dcfa101b96681a5cd496aa35d68e9acc7fa
|
7
|
+
data.tar.gz: df0b4f5db1d91ce34d3aa063ff42bf56206e43527d36c7f0bdb0b753692108bfb24fd0ae03447c089c5107d9ba7210a2019e3a2e046ab91902ca07b87402e284
|
data/README.md
CHANGED
@@ -12,41 +12,67 @@ 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
|
+
submit_for_review: false,
|
31
|
+
|
32
|
+
privacy_policy_url: "https://example.com",
|
33
|
+
changelog_path: "<PATH_TO_CHANGELOG_FILE>",
|
34
|
+
|
35
|
+
# release time to release app on specific date
|
36
|
+
release_time: "2019-12-25T07:05:15+0000",
|
37
|
+
|
38
|
+
# For phase wise release: set these parameters
|
39
|
+
phase_wise_release: true,
|
40
|
+
phase_release_start_time: "2019-12-25T07:05:15+0000",
|
41
|
+
phase_release_end_time: "2019-12-28T07:05:15+0000",
|
42
|
+
phase_release_percent: "10.00",
|
43
|
+
phase_release_description: "<DESCRIPTION>"
|
44
|
+
)
|
31
45
|
```
|
32
46
|
|
33
|
-
|
34
|
-
```
|
35
|
-
rubocop -a
|
36
|
-
```
|
47
|
+
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
48
|
|
38
|
-
|
39
|
-
|
40
|
-
|
49
|
+
```
|
50
|
+
huawei_appgallery_connect_submit_for_review(
|
51
|
+
client_id: "<CLIENT_ID>",
|
52
|
+
client_secret: "<CLIENT_SECRET>",
|
53
|
+
app_id: "<APP_ID>",
|
41
54
|
|
42
|
-
## Troubleshooting
|
43
55
|
|
44
|
-
|
56
|
+
# Optional, Parameter beyond this are optional
|
45
57
|
|
46
|
-
|
58
|
+
# release time to release app on specific date
|
59
|
+
release_time: "2019-12-25T07:05:15+0000",
|
47
60
|
|
48
|
-
For
|
61
|
+
# For phase wise release: set these parameters
|
62
|
+
phase_wise_release: true,
|
63
|
+
phase_release_start_time: "2019-12-25T07:05:15+0000",
|
64
|
+
phase_release_end_time: "2019-12-28T07:05:15+0000",
|
65
|
+
phase_release_percent: "10.00",
|
66
|
+
phase_release_description: "<DESCRIPTION>"
|
67
|
+
)
|
68
|
+
```
|
69
|
+
You can also retreive app info by making use of the following action
|
49
70
|
|
50
|
-
|
71
|
+
```
|
72
|
+
huawei_appgallery_connect_get_app_info(
|
73
|
+
client_id: "<CLIENT_ID>",
|
74
|
+
client_secret: "<CLIENT_SECRET>",
|
75
|
+
app_id: "<APP_ID>"
|
76
|
+
)
|
51
77
|
|
52
|
-
|
78
|
+
```
|
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)",
|
@@ -0,0 +1,107 @@
|
|
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
|
+
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,
|
97
|
+
type: String)
|
98
|
+
]
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.is_supported?(platform)
|
102
|
+
[:android].include?(platform)
|
103
|
+
true
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
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
|
|
@@ -235,3 +242,4 @@ module Fastlane
|
|
235
242
|
end
|
236
243
|
end
|
237
244
|
end
|
245
|
+
|
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.13
|
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-13 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
|