fastlane-plugin-pgyer 0.2.8 → 0.3.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: d1b63cb189966ff6893098dcd7b8720dee79ad87ba3d50ffc05b5eae6559673a
4
- data.tar.gz: 74f4bd228aad0cd218ba9d8dff1b705c293f8b9e36580d01c78a437d0eae49d9
3
+ metadata.gz: 741284528b903fbc1a290128b51cbed6edaa428d734da99514a3e15e353d0534
4
+ data.tar.gz: 6fe64045b3a0fecb3da47ed3cc8a7d3915736a0e85f47a4bcb5386f9a4a19373
5
5
  SHA512:
6
- metadata.gz: 9ef5ffa5c621a464240cfad1a8f436d8bfb4e9bc44719315a83168c826c0b39b13b189a971686f893ad8173f63be7bbb2a4317af9c16c29dea9ac55eb20c1e43
7
- data.tar.gz: 0ebbd2dc74d1c2df1b04fa2a6a5dad5f9c1e950bf443be98c96e9e00f44d4e06e61e733981dd8582b079c53e97563f7bf6c2d08efbe2c32d9e9f11bc0cc150f0
6
+ metadata.gz: 94cef84dc0babdac14f62ed7d4ea53a73ff72bf788f463517743c921a427c30c8c6fc82a69ce4fbb5c0f19e922d457dedd5c4e31baed3402323b8960ae3005a7
7
+ data.tar.gz: 4eeef611fdc5c90845577d22d7f1f541598313a19776c459c032ea483d3c1f4b3a41ef05700facad77f82f5193491693668488c8c7202e9db21d9d2ebc747397
data/README.md CHANGED
@@ -66,7 +66,7 @@ end
66
66
  ```
67
67
 
68
68
  Set a version update description for App:
69
-
69
+ acd88a1a52f0818dc7923150c4d86f08
70
70
  ```
71
71
  lane :beta do
72
72
  gym
@@ -95,6 +95,22 @@ end
95
95
  ```
96
96
 
97
97
 
98
+ HAP file upload
99
+
100
+ pgyer supports hap file to upload, use params hap to specify the absolute file path.
101
+
102
+ ```ruby
103
+ lane :beta do
104
+ gym
105
+ pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", hap: "xxxx")
106
+ end
107
+ ```
108
+
109
+ or in bash
110
+ ```bash
111
+ fastlane run pgyer api_key:7f15xxxxxxxxxxxxxxxxxx141 hap:xxx.hap
112
+ ```
113
+
98
114
 
99
115
 
100
116
  And more params
@@ -115,8 +131,12 @@ install_end_date: The value is a string of characters, such as 2018-12-31.
115
131
 
116
132
  channel: Need to update the specified channel of the download short link, can specify only one channel, string type, such as: ABCD. Specifies channel uploads. If you do not have one, do not use this parameter.
117
133
 
134
+ user_download_file_name: The name of the file downloaded by the user, the string type, such as: test.apk.
135
+
118
136
  save_uploaded_info_json: (true or false, default to false) Whether to save the information returned by the API interface to a json file.
119
137
 
138
+
139
+
120
140
  ```
121
141
  ## Run tests for this plugin
122
142
 
@@ -12,13 +12,14 @@ module Fastlane
12
12
  build_file = [
13
13
  params[:ipa],
14
14
  params[:apk],
15
+ params[:hap],
15
16
  ].detect { |e| !e.to_s.empty? }
16
17
 
17
18
  if build_file.nil?
18
19
  UI.user_error!("You have to provide a build file")
19
20
  end
20
21
 
21
- type = params[:ipa].nil? ? "android" : "ios"
22
+ type = get_type(params)
22
23
 
23
24
  UI.message "build_file: #{build_file}, type: #{type}"
24
25
 
@@ -100,10 +101,20 @@ module Fastlane
100
101
  UI.user_error!("Get token is failed")
101
102
  end
102
103
  content_type = type == "android" ? "application/vnd.android.package-archive" : "application/octet-stream"
104
+
105
+ if !params[:user_download_file_name].nil?
106
+ request_params["x-cos-meta-file-name"] = params[:user_download_file_name]
107
+ end
103
108
  request_params["file"] = Faraday::UploadIO.new(build_file, content_type)
104
109
 
105
110
  UI.message "Start upload #{build_file} to pgyer..."
106
111
 
112
+ UI.message "Upload endpoint: #{endpoint}"
113
+
114
+ UI.message "Upload request_params: #{request_params}"
115
+
116
+
117
+
107
118
  response = pgyer_client.post endpoint, request_params
108
119
 
109
120
  if response.status != 204
@@ -152,10 +163,21 @@ module Fastlane
152
163
  verify_block: proc do |value|
153
164
  UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
154
165
  end,
155
- conflicting_options: [:ipa],
166
+ conflicting_options: [:ipa, :hap],
156
167
  conflict_block: proc do |value|
157
168
  UI.user_error!("You can't use 'apk' and '#{value.key}' options in one run")
158
169
  end),
170
+ FastlaneCore::ConfigItem.new(key: :hap,
171
+ env_name: "PGYER_HAP",
172
+ description: "Path to your HAP file",
173
+ optional: true,
174
+ verify_block: proc do |value|
175
+ UI.user_error!("Couldn't find hap file at path '#{value}'") unless File.exist?(value)
176
+ end,
177
+ conflicting_options: [:ipa, :apk],
178
+ conflict_block: proc do |value|
179
+ UI.user_error!("You can't use 'hap' and '#{value.key}' options in one run")
180
+ end),
159
181
  FastlaneCore::ConfigItem.new(key: :ipa,
160
182
  env_name: "PGYER_IPA",
161
183
  description: "Path to your IPA file. Optional if you use the _gym_ or _xcodebuild_ action. For Mac zip the .app. For Android provide path to .apk file",
@@ -164,15 +186,34 @@ module Fastlane
164
186
  verify_block: proc do |value|
165
187
  UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
166
188
  end,
167
- conflicting_options: [:apk],
189
+ conflicting_options: [:apk, :hap],
168
190
  conflict_block: proc do |value|
169
191
  UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run")
170
192
  end),
193
+ FastlaneCore::ConfigItem.new(key: :hap,
194
+ env_name: "PGYER_HAP",
195
+ description: "Path to your HAP file. Optional if you use the _gym_ or _xcodebuild_ action. For Mac zip the .app. For Android provide path to .apk file",
196
+ default_value: Actions.lane_context[:HVIGOR_HAP_OUTPUT_PATH],
197
+ optional: true,
198
+ verify_block: proc do |value|
199
+ UI.user_error!("Couldn't find hap file at path '#{value}'") unless File.exist?(value)
200
+ end,
201
+ conflicting_options: [:apk, :ipa],
202
+ conflict_block: proc do |value|
203
+ UI.user_error!("You can't use 'hap' and '#{value.key}' options in one run")
204
+ end),
171
205
  FastlaneCore::ConfigItem.new(key: :password,
172
206
  env_name: "PGYER_PASSWORD",
173
207
  description: "Set password to protect app",
174
208
  optional: true,
175
209
  type: String),
210
+
211
+ FastlaneCore::ConfigItem.new(key: :user_download_file_name,
212
+ env_name: "USER_DOWNLOAD_FILE_NAME",
213
+ description: "Rename the file name that user downloaded from pgyer",
214
+ optional: true,
215
+ type: String),
216
+
176
217
  FastlaneCore::ConfigItem.new(key: :update_description,
177
218
  env_name: "PGYER_UPDATE_DESCRIPTION",
178
219
  description: "Set update description for app",
@@ -231,6 +272,16 @@ module Fastlane
231
272
 
232
273
  private
233
274
 
275
+ def self.get_type(params)
276
+ type = params[:ipa].nil? ? "android" : "ios"
277
+
278
+ if !params[:hap].nil?
279
+ type = "hap"
280
+ end
281
+
282
+ type
283
+ end
284
+
234
285
  def self.checkPublishStatus(client, api_host, api_key, buildKey)
235
286
  url ="#{api_host}/buildInfo"
236
287
  UI.message "checkPublishStatus url: #{url}"
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Pgyer
3
- VERSION = "0.2.8"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-pgyer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rexshi
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-17 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -150,7 +149,6 @@ dependencies:
150
149
  - - ">="
151
150
  - !ruby/object:Gem::Version
152
151
  version: '0'
153
- description:
154
152
  email: rexshi@pgyer.com
155
153
  executables: []
156
154
  extensions: []
@@ -166,7 +164,6 @@ homepage: https://github.com/shishirui/fastlane-plugin-pgyer
166
164
  licenses:
167
165
  - MIT
168
166
  metadata: {}
169
- post_install_message:
170
167
  rdoc_options: []
171
168
  require_paths:
172
169
  - lib
@@ -181,8 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
178
  - !ruby/object:Gem::Version
182
179
  version: '0'
183
180
  requirements: []
184
- rubygems_version: 3.4.6
185
- signing_key:
181
+ rubygems_version: 3.7.1
186
182
  specification_version: 4
187
183
  summary: distribute app to pgyer beta testing service
188
184
  test_files: []