fastlane-plugin-amazon_appstore 1.5.0 → 1.6.0

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: 4329f021e36ea416d3dbe494fea656223f7681f01fdaf8c12c067850bd66d042
4
- data.tar.gz: 5015e8ed07f219d28398b38d4c684db0ddae6342a84270a02cea9c001015041b
3
+ metadata.gz: fe05c393d60b47ae7056bba08ebecb83c0938413d9773fafbf4523561a3d80cb
4
+ data.tar.gz: 7ffcd28240b237ebc7d30b9c865b4521662bdd28a9cd33613087f6d7765ed558
5
5
  SHA512:
6
- metadata.gz: 4b213a4b4855aa766bb8a5bd789a1c8cfae4ea1a6786d66986828442672b96030b45bc881bb30e8bcd513437396229f004ababe31c6b817b399f4cc23d9eb117
7
- data.tar.gz: 5bee681d6820d171c9a09c33da5ac3306e3583156748128684c88596d69159a5b4e1858a9a2adf3f90c68a24264cb6f1c06eb56750aaac4fcda4972e8e490fd0
6
+ metadata.gz: aa9e81ecd54a493a472978e12a151d24314b04177771ff3448e89b88bf5e00c622816582671ae52beba5dc6340f4eb16fb2fabe4bc309b788153fbd3a6db761a
7
+ data.tar.gz: 0d5c668cf8d8d77c5275b26bf17043b22a584f0f5b0d271edfc50b355e76e0c05acacf618350de4747a6941dd112e1511f9a28515f7db9d78aca937534e50a25
@@ -93,7 +93,7 @@ module Fastlane
93
93
 
94
94
  UI.message("Updating release notes...")
95
95
  begin
96
- Helper::AmazonAppstoreHelper.update_listings_for_multiple_apks(
96
+ Helper::AmazonAppstoreHelper.update_changelogs(
97
97
  app_id: params[:package_name],
98
98
  edit_id: edit_id,
99
99
  token: token,
@@ -103,7 +103,7 @@ module Fastlane
103
103
  )
104
104
  rescue StandardError => e
105
105
  UI.error(e.message)
106
- UI.abort_with_message!("Failed to update listings")
106
+ UI.abort_with_message!("Failed to update changelogs")
107
107
  end
108
108
 
109
109
  upload_metadata(params, edit_id, token) unless params[:skip_upload_metadata]
@@ -99,7 +99,6 @@ module Fastlane
99
99
  existing_apks = get_apks_response.body
100
100
  raise StandardError, 'No existing APKs found in edit' if existing_apks.empty?
101
101
 
102
- version_codes = []
103
102
  apk_results = []
104
103
 
105
104
  apk_paths.each_with_index do |apk_path, index|
@@ -129,7 +128,6 @@ module Fastlane
129
128
  raise StandardError, replace_apk_response.body unless replace_apk_response.success?
130
129
 
131
130
  version_code = replace_apk_response.body[:versionCode]
132
- version_codes << version_code
133
131
  apk_results << { version_code: version_code, apk_id: apk_id }
134
132
  else
135
133
  # Upload new APK if there are more APK paths than existing APKs
@@ -139,7 +137,6 @@ module Fastlane
139
137
  edit_id: edit_id,
140
138
  token: token
141
139
  )
142
- version_codes << result[:version_code]
143
140
  apk_results << result
144
141
  end
145
142
  end
@@ -184,20 +181,20 @@ module Fastlane
184
181
  UI.message("Successfully deleted APK #{apk_id}")
185
182
  end
186
183
 
187
- def self.update_listings_for_multiple_apks(app_id:, edit_id:, token:, version_codes:, skip_upload_changelogs:, metadata_path:)
184
+ def self.update_changelogs(app_id:, edit_id:, token:, version_codes:, skip_upload_changelogs:, metadata_path:)
188
185
  return if skip_upload_changelogs
189
186
  return if version_codes.empty?
190
187
 
191
- UI.message("Updating listings for #{version_codes.length} version codes: #{version_codes.join(', ')}")
188
+ # Use the highest version code's changelog (same as Fastlane's approach)
189
+ max_version_code = version_codes.max
190
+ UI.message("Updating changelogs using highest version code: #{max_version_code}")
192
191
 
193
- # Get listings once with ETag
194
192
  listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings"
195
193
  listings_response = api_client.get(listings_path) do |request|
196
194
  request.headers['Authorization'] = "Bearer #{token}"
197
195
  end
198
196
  raise StandardError, listings_response.body unless listings_response.success?
199
197
 
200
- # Process each language once
201
198
  listings_response.body[:listings].each do |lang, listing|
202
199
  # Get fresh ETag for each language update to avoid conflicts
203
200
  etag_response = api_client.get(listings_path) do |request|
@@ -207,48 +204,12 @@ module Fastlane
207
204
 
208
205
  etag = etag_response.headers['Etag']
209
206
 
210
- # Find the best changelog for multiple version codes
211
- recent_changes = find_changelog_for_multiple_version_codes(
207
+ listing[:recentChanges] = find_changelog(
212
208
  language: listing[:language],
213
- version_codes: version_codes,
209
+ version_code: max_version_code,
210
+ skip_upload_changelogs: false,
214
211
  metadata_path: metadata_path
215
212
  )
216
- listing[:recentChanges] = recent_changes
217
-
218
- # Update listings once per language
219
- update_listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings/#{lang}"
220
- update_listings_response = api_client.put(update_listings_path) do |request|
221
- request.body = listing.to_json
222
- request.headers['Authorization'] = "Bearer #{token}"
223
- request.headers['If-Match'] = etag
224
- end
225
- raise StandardError, update_listings_response.body unless update_listings_response.success?
226
- end
227
- nil
228
- end
229
-
230
- def self.update_listings(app_id:, edit_id:, token:, version_code:, skip_upload_changelogs:, metadata_path:)
231
- listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings"
232
- listings_response = api_client.get(listings_path) do |request|
233
- request.headers['Authorization'] = "Bearer #{token}"
234
- end
235
- raise StandardError, listings_response.body unless listings_response.success?
236
-
237
- listings_response.body[:listings].each do |lang, listing|
238
- etag_response = api_client.get(listings_path) do |request|
239
- request.headers['Authorization'] = "Bearer #{token}"
240
- end
241
- raise StandardError, etag_response.body unless etag_response.success?
242
-
243
- etag = etag_response.headers['Etag']
244
-
245
- recent_changes = find_changelog(
246
- language: listing[:language],
247
- version_code: version_code,
248
- skip_upload_changelogs: skip_upload_changelogs,
249
- metadata_path: metadata_path
250
- )
251
- listing[:recentChanges] = recent_changes
252
213
 
253
214
  update_listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings/#{lang}"
254
215
  update_listings_response = api_client.put(update_listings_path) do |request|
@@ -439,18 +400,6 @@ module Fastlane
439
400
  end
440
401
  private_class_method :auth_client
441
402
 
442
- def self.find_changelog_for_multiple_version_codes(language:, version_codes:, metadata_path:)
443
- # Use the highest version code's changelog (same as Fastlane's approach)
444
- max_version_code = version_codes.max
445
- UI.message("Using changelog for highest version code: #{max_version_code}")
446
- find_changelog(
447
- language: language,
448
- version_code: max_version_code,
449
- skip_upload_changelogs: false,
450
- metadata_path: metadata_path
451
- )
452
- end
453
-
454
403
  def self.find_changelog(language:, version_code:, skip_upload_changelogs:, metadata_path:)
455
404
  # The Amazon appstore requires you to enter changelogs before reviewing.
456
405
  # Therefore, if there is no metadata, hyphen text is returned.
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AmazonAppstore
3
- VERSION = "1.5.0"
3
+ VERSION = "1.6.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-amazon_appstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ntsk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-29 00:00:00.000000000 Z
11
+ date: 2026-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: 1.12.0
48
48
  - - "<"
49
49
  - !ruby/object:Gem::Version
50
- version: 3.0.0
50
+ version: 5.0.0
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +57,7 @@ dependencies:
57
57
  version: 1.12.0
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
- version: 3.0.0
60
+ version: 5.0.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: fastlane
63
63
  requirement: !ruby/object:Gem::Requirement