fastlane-plugin-huawei_appgallery_connect 1.0.31 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98831161a83658dce388e7f73e9912ead91b1064d7ab60da42a4035bbbfa08a2
4
- data.tar.gz: e050a3fe31dc500b966de2f8fbce707832129b2021e460993264af08b312576d
3
+ metadata.gz: 1db69408fdf91d46ff13f056cb8da5201d03b0d349c47e8d55ab29de1f42ae5a
4
+ data.tar.gz: 7004c7b1659840a416ab7e9740035d78e36c4a8a597f95025a2639a9e5d58bd4
5
5
  SHA512:
6
- metadata.gz: 1a5d235f38c6b72c0b98b2eca913a58dcb1cb2fc913dd3064198a005c239ce05bdbdf66a8c23aed9925ddb19ee707c26b723f38a04f72e524988062a96faf8da
7
- data.tar.gz: 00435d7b41783d5f5a1495ab0464a778bd825be960a007c1dca33e268531aaf125956e35efebdceeedeb752ec38de6ebf37947679f5604cde95d41c0963c39a1
6
+ metadata.gz: 7ceff10bcff4da7d6fafc25f2b7b9290a70c1514bc3d27dd49a1fcf02f345000f56f9e2b882f68dbc398134b3aa7317731d5ea2940f8e9e58a88b6446408050f
7
+ data.tar.gz: f1fb6ecc068691c18fa2cd6555182faeae07fccc14ba4fa62034b735f1030ef42346c98c482c2bfcb5677007bba0267714c748e4a3f36d29ed5a993ed88f6808
data/README.md CHANGED
@@ -18,7 +18,7 @@ Huawei AppGallery Connect Plugin can be used to upload Android application on th
18
18
 
19
19
  To get started you will need the client id, client Secret & app ID which can be obtained from your Huawei AppGallery Connect account OR can be obtained with huawei_appgallery_connect_get_app_id action (please see example below).
20
20
 
21
- ```
21
+ ```ruby
22
22
  huawei_appgallery_connect(
23
23
  client_id: "<CLIENT_ID>",
24
24
  client_secret: "<CLIENT_SECRET>",
@@ -46,13 +46,20 @@ huawei_appgallery_connect(
46
46
  phase_release_start_time: "2019-12-25T07:05:15+0000",
47
47
  phase_release_end_time: "2019-12-28T07:05:15+0000",
48
48
  phase_release_percent: "10.00",
49
- phase_release_description: "<DESCRIPTION>"
49
+ phase_release_description: "<DESCRIPTION>",
50
+
51
+ # For open testing configuration
52
+ use_testing_version: true, # Enable open testing
53
+ skip_manual_review: true, # Skip manual review for internal testing (default: true)
54
+ test_start_time: "2024-03-20T10:00:00+0000", # Optional: Test start time (defaults to 1 hour from now)
55
+ test_end_time: "2024-06-08T10:00:00+0000", # Optional: Test end time (defaults to 80 days from start)
56
+ feedback_email: "test@example.com" # Email for test feedback
50
57
  )
51
58
  ```
52
59
 
53
- You can retreive app id by making use of the following action
60
+ You can retrieve app id by making use of the following action
54
61
 
55
- ```
62
+ ```ruby
56
63
  huawei_appgallery_connect_get_app_id(
57
64
  client_id: "<CLIENT_ID>",
58
65
  client_secret: "<CLIENT_SECRET>",
@@ -62,7 +69,7 @@ huawei_appgallery_connect_get_app_id(
62
69
 
63
70
  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
64
71
 
65
- ```
72
+ ```ruby
66
73
  huawei_appgallery_connect_submit_for_review(
67
74
  client_id: "<CLIENT_ID>",
68
75
  client_secret: "<CLIENT_SECRET>",
@@ -78,12 +85,20 @@ huawei_appgallery_connect_submit_for_review(
78
85
  phase_release_start_time: "2019-12-25T07:05:15+0000",
79
86
  phase_release_end_time: "2019-12-28T07:05:15+0000",
80
87
  phase_release_percent: "10.00",
81
- phase_release_description: "<DESCRIPTION>"
88
+ phase_release_description: "<DESCRIPTION>",
89
+
90
+ # For open testing configuration
91
+ use_testing_version: true, # Enable open testing
92
+ skip_manual_review: true, # Skip manual review for internal testing (default: true)
93
+ test_start_time: "2024-03-20T10:00:00+0000", # Optional: Test start time (defaults to 1 hour from now)
94
+ test_end_time: "2024-06-08T10:00:00+0000", # Optional: Test end time (defaults to 80 days from start)
95
+ feedback_email: "test@example.com" # Email for test feedback
82
96
  )
83
97
  ```
84
- You can also retreive app info by making use of the following action
85
98
 
86
- ```
99
+ You can also retrieve app info by making use of the following action
100
+
101
+ ```ruby
87
102
  huawei_appgallery_connect_get_app_info(
88
103
  client_id: "<CLIENT_ID>",
89
104
  client_secret: "<CLIENT_SECRET>",
@@ -93,7 +108,7 @@ huawei_appgallery_connect_get_app_info(
93
108
 
94
109
  To update the app's metadata like release notes, app name, brief info and app description you can make use of the following action
95
110
 
96
- ```
111
+ ```ruby
97
112
  huawei_appgallery_connect_update_app_localization(
98
113
  client_id: "<CLIENT_ID>",
99
114
  client_secret: "<CLIENT_SECRET>",
@@ -104,7 +119,7 @@ huawei_appgallery_connect_update_app_localization(
104
119
 
105
120
  To update the GMS dependency of the app, use the following action
106
121
 
107
- ```
122
+ ```ruby
108
123
  huawei_appgallery_connect_set_gms_dependency(
109
124
  client_id: "<CLIENT_ID>",
110
125
  client_secret: "<CLIENT_SECRET>",
@@ -116,18 +131,47 @@ huawei_appgallery_connect_set_gms_dependency(
116
131
  Your folder structure for applying multiple languages for the metadata should look like this:
117
132
 
118
133
  ```
119
- └── fastlane
120
- └── metadata
121
- └── huawei
122
- ├── en-US
123
- │ ├── app_name.txt
124
- └── app_description.txt
125
- └── introduction.txt
126
- │ └── release_notes.txt
127
- └── fr-FR
128
- ├── app_name.txt
129
- └── app_description.txt
130
- └── introduction.txt
131
- └── release_notes.txt
134
+ fastlane
135
+ └── metadata
136
+ └── huawei
137
+ ├── en-US
138
+ │ ├── app_name
139
+ ├── app_description
140
+ ├── introduction
141
+ │ └── release_notes
142
+ └── zh-CN
143
+ ├── app_name
144
+ ├── app_description
145
+ ├── introduction
146
+ └── release_notes
147
+ ```
148
+
149
+ ## Run tests for this plugin
150
+
151
+ To run both the tests, and code style validation, run
152
+
153
+ ```
154
+ rake
132
155
  ```
133
156
 
157
+ To automatically fix many of the styling issues, use
158
+ ```
159
+ rubocop -a
160
+ ```
161
+
162
+ ## Issues and Feedback
163
+
164
+ For any other issues and feedback about this plugin, please submit it to this repository.
165
+
166
+ ## Troubleshooting
167
+
168
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
169
+
170
+ ## Using _fastlane_ Plugins
171
+
172
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
173
+
174
+ ## About _fastlane_
175
+
176
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
177
+
@@ -10,7 +10,6 @@ module Fastlane
10
10
  if token.nil?
11
11
  UI.message("Cannot retrieve token, please check your client ID and client secret")
12
12
  else
13
-
14
13
  if params[:privacy_policy_url] != nil
15
14
  Helper::HuaweiAppgalleryConnectHelper.update_appinfo(params[:client_id], token, params[:app_id], params[:privacy_policy_url])
16
15
  end
@@ -24,9 +23,7 @@ module Fastlane
24
23
  sleep(params[:delay_before_submit_for_review])
25
24
  end
26
25
  self.submit_for_review(token, upload_app, params)
27
-
28
26
  end
29
- # Helper::HuaweiAppgalleryConnectHelper.getAppInfo(token, params[:client_id], params[:app_id])
30
27
  end
31
28
 
32
29
  def self.submit_for_review(token, upload_app, params)
@@ -95,52 +92,52 @@ module Fastlane
95
92
  optional: true,
96
93
  type: Boolean),
97
94
 
98
- FastlaneCore::ConfigItem.new(key: :changelog_path,
99
- env_name: "HUAWEI_APPGALLERY_CONNECT_CHANGELOG_PATH",
100
- description: "Path to Changelog file (Default empty)",
101
- optional: true,
102
- type: String),
103
-
104
95
  FastlaneCore::ConfigItem.new(key: :privacy_policy_url,
105
- env_name: "HUAWEI_APPGALLERY_CONNECT_PRIVACY",
106
- description: "Privacy Policy URL",
107
- optional: true,
108
- type: String),
96
+ env_name: "HUAWEI_APPGALLERY_CONNECT_PRIVACY_POLICY",
97
+ description: "Privacy Policy URL",
98
+ optional: true,
99
+ type: String),
100
+
101
+ FastlaneCore::ConfigItem.new(key: :changelog_path,
102
+ env_name: "HUAWEI_APPGALLERY_CONNECT_CHANGELOG_PATH",
103
+ description: "Path to Changelog file (Default empty)",
104
+ optional: true,
105
+ type: String),
109
106
 
110
107
  FastlaneCore::ConfigItem.new(key: :phase_wise_release,
111
- env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE",
112
- description: "Phase wise release",
113
- optional: true,
114
- conflicting_options: [:release_time],
115
- type: Boolean),
108
+ env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE",
109
+ description: "Phase wise release",
110
+ optional: true,
111
+ conflicting_options: [:release_time],
112
+ type: Boolean),
116
113
 
117
114
  FastlaneCore::ConfigItem.new(key: :phase_release_start_time,
118
- env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_START_TIME",
119
- 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",
120
- optional: true,
121
- type: String),
115
+ env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_RELEASE_START_TIME",
116
+ description: "Phase release start time in UTC format (yyyy-MM-dd'T'HH:mm:ssZZ)",
117
+ optional: true,
118
+ type: String),
122
119
 
123
120
  FastlaneCore::ConfigItem.new(key: :phase_release_end_time,
124
- env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_END_TIME",
125
- 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",
126
- optional: true,
127
- type: String),
121
+ env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_RELEASE_END_TIME",
122
+ description: "Phase release end time in UTC format (yyyy-MM-dd'T'HH:mm:ssZZ)",
123
+ optional: true,
124
+ type: String),
128
125
 
129
126
  FastlaneCore::ConfigItem.new(key: :phase_release_percent,
130
- env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_PERCENT",
131
- description: "Percentage of the release by phase. The value must be accurate to two decimal places and does not contain the percent sign (%)",
132
- optional: true,
133
- type: String),
127
+ env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_RELEASE_PERCENT",
128
+ description: "Percentage of phase release (0-100)",
129
+ optional: true,
130
+ type: String),
134
131
 
135
132
  FastlaneCore::ConfigItem.new(key: :phase_release_description,
136
- env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_DESCRIPTION",
137
- description: "Phase-based release description. (Max 500 characters)",
138
- optional: true,
139
- type: String),
133
+ env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_RELEASE_DESCRIPTION",
134
+ description: "Phase release description",
135
+ optional: true,
136
+ type: String),
140
137
 
141
138
  FastlaneCore::ConfigItem.new(key: :release_time,
142
139
  env_name: "HUAWEI_APPGALLERY_CONNECT_RELEASE_TIME",
143
- description: "Release time in UTC format for app release on a specific date. The format is yyyy-MM-dd'T'HH:mm:ssZZ)",
140
+ description: "Release time in UTC format for app release on a specific date (yyyy-MM-dd'T'HH:mm:ssZZ)",
144
141
  optional: true,
145
142
  conflicting_options: [:phase_wise_release],
146
143
  type: String),
@@ -163,11 +160,44 @@ module Fastlane
163
160
  optional: true,
164
161
  type: Integer),
165
162
 
166
- FastlaneCore::ConfigItem.new(key: :package_ids,
167
- env_name: "HUAWEI_APPGALLERY_PACKAGE_IDS",
168
- description: "App Package IDs separated by commas",
169
- optional: true,
170
- type: String)
163
+ FastlaneCore::ConfigItem.new(key: :package_ids,
164
+ env_name: "HUAWEI_APPGALLERY_PACKAGE_IDS",
165
+ description: "App Package IDs separated by commas",
166
+ optional: true,
167
+ type: String),
168
+
169
+ # Open Testing Configuration
170
+ FastlaneCore::ConfigItem.new(key: :use_testing_version,
171
+ env_name: "HUAWEI_APPGALLERY_USE_TESTING_VERSION",
172
+ description: "Enable open testing for the app",
173
+ optional: true,
174
+ default_value: false,
175
+ type: Boolean),
176
+
177
+ FastlaneCore::ConfigItem.new(key: :skip_manual_review,
178
+ env_name: "HUAWEI_APPGALLERY_SKIP_MANUAL_REVIEW",
179
+ description: "Skip manual review for internal testing",
180
+ optional: true,
181
+ default_value: true,
182
+ type: Boolean),
183
+
184
+ FastlaneCore::ConfigItem.new(key: :test_start_time,
185
+ env_name: "HUAWEI_APPGALLERY_TEST_START_TIME",
186
+ description: "Test start time in UTC format (yyyy-MM-dd'T'HH:mm:ssZZ). If not provided, defaults to 1 hour from now",
187
+ optional: true,
188
+ type: String),
189
+
190
+ FastlaneCore::ConfigItem.new(key: :test_end_time,
191
+ env_name: "HUAWEI_APPGALLERY_TEST_END_TIME",
192
+ description: "Test end time in UTC format (yyyy-MM-dd'T'HH:mm:ssZZ). If not provided, defaults to 80 days from start time",
193
+ optional: true,
194
+ type: String),
195
+
196
+ FastlaneCore::ConfigItem.new(key: :feedback_email,
197
+ env_name: "HUAWEI_APPGALLERY_FEEDBACK_EMAIL",
198
+ description: "Email address for test feedback",
199
+ optional: true,
200
+ type: String)
171
201
  ]
172
202
  end
173
203
 
@@ -94,7 +94,14 @@ module Fastlane
94
94
  env_name: "HUAWEI_APPGALLERY_CONNECT_CHANGELOG_PATH",
95
95
  description: "Path to Changelog file (Default empty)",
96
96
  optional: true,
97
- type: String)
97
+ type: String),
98
+
99
+ FastlaneCore::ConfigItem.new(key: :use_testing_version,
100
+ env_name: "HUAWEI_APPGALLERY_USE_TESTING_VERSION",
101
+ description: "Enable open testing for the app",
102
+ optional: true,
103
+ default_value: false,
104
+ type: Boolean),
98
105
  ]
99
106
  end
100
107
 
@@ -1,5 +1,6 @@
1
1
  require 'fastlane_core/ui/ui'
2
2
  require 'cgi'
3
+ require 'time'
3
4
 
4
5
  module Fastlane
5
6
  UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
@@ -253,14 +254,20 @@ module Fastlane
253
254
 
254
255
  release_type = ''
255
256
  release_time = ''
256
-
257
- if (params[:phase_wise_release] != nil && params[:phase_wise_release]) && (
257
+ test_config = {}
258
+
259
+ # Handle open testing configuration
260
+ if params[:use_testing_version]
261
+ UI.important("Configuring open testing")
262
+ test_config = prepare_test_config(params)
263
+ release_type = '&releaseType=1' # Open testing release type
264
+ elsif (params[:phase_wise_release] != nil && params[:phase_wise_release]) && (
258
265
  params[:phase_release_start_time] == nil ||
259
266
  params[:phase_release_end_time] == nil ||
260
267
  params[:phase_release_percent] == nil ||
261
268
  params[:phase_release_description] == nil
262
269
  )
263
- UI.user_error!("Submit for review failed. Phase wise release requires Start time, End time Release Percent & Descrption")
270
+ UI.user_error!("Submit for review failed. Phase wise release requires Start time, End time Release Percent & Description")
264
271
  return
265
272
  elsif params[:phase_wise_release] != nil && params[:phase_wise_release]
266
273
  release_type = '&releaseType=3'
@@ -300,8 +307,14 @@ module Fastlane
300
307
  phasedReleasePercent: params[:phase_release_percent],
301
308
  phasedReleaseDescription: params[:phase_release_description]
302
309
  }.to_json
310
+ elsif params[:use_testing_version]
311
+ test_config[:releaseType] = 1 # Explicitly set release type for open testing
312
+ request.body = test_config.to_json
303
313
  end
304
314
 
315
+ UI.important("Request URL: #{uri.to_s}")
316
+ UI.important("Request Body: #{request.body}")
317
+
305
318
  response = http.request(request)
306
319
 
307
320
  if !response.kind_of? Net::HTTPSuccess
@@ -312,7 +325,7 @@ module Fastlane
312
325
  result_json = JSON.parse(response.body)
313
326
 
314
327
  if result_json['ret']['code'] == 0
315
- UI.success("Successfully submitted app for review")
328
+ UI.success("Successfully submitted app for review")
316
329
  elsif result_json['ret']['code'] == 204144660 && result_json['ret']['msg'].include?("It may take 2-5 minutes")
317
330
  UI.important(result_json)
318
331
  UI.important("Build is currently processing, waiting for 2 minutes before submitting again...")
@@ -322,7 +335,32 @@ module Fastlane
322
335
  UI.user_error!(result_json)
323
336
  UI.user_error!("Failed to submit app for review.")
324
337
  end
338
+ end
325
339
 
340
+ def self.prepare_test_config(params)
341
+ # Calculate test start time (1 hour from now if not provided)
342
+ start_time = if params[:test_start_time]
343
+ Time.parse(params[:test_start_time])
344
+ else
345
+ Time.now + (60 * 60) # 1 hour from now
346
+ end
347
+
348
+ # Calculate test end time (80 days from start if not provided)
349
+ end_time = if params[:test_end_time]
350
+ Time.parse(params[:test_end_time])
351
+ else
352
+ start_time + (80 * 24 * 60 * 60) # 80 days from start
353
+ end
354
+
355
+ {
356
+ testStartTime: start_time.strftime('%Y-%m-%dT%H:%M:%S+0000'),
357
+ testEndTime: end_time.strftime('%Y-%m-%dT%H:%M:%S+0000'),
358
+ skipManualReview: params[:skip_manual_review] != false,
359
+ feedbackEmail: params[:feedback_email],
360
+ releaseType: 1, # Force open testing release type
361
+ testPhase: true, # Explicitly set test phase
362
+ testMode: 1 # Set test mode to open testing
363
+ }
326
364
  end
327
365
 
328
366
  def self.update_app_localization_info(token, params)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module HuaweiAppgalleryConnect
3
- VERSION = "1.0.31"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  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.31
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shreejan Shrestha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-18 00:00:00.000000000 Z
11
+ date: 2025-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry