fastlane-plugin-amazon_appstore 1.5.0 → 1.6.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: 4329f021e36ea416d3dbe494fea656223f7681f01fdaf8c12c067850bd66d042
4
- data.tar.gz: 5015e8ed07f219d28398b38d4c684db0ddae6342a84270a02cea9c001015041b
3
+ metadata.gz: 5c51392a7329c7598b6a5a10e2e2a19e786af178493684b66822771af63e3d3a
4
+ data.tar.gz: a9476c2fb18dc10f56b8d37a374d365d2a1ea2cbd94b666706273a5a807a148c
5
5
  SHA512:
6
- metadata.gz: 4b213a4b4855aa766bb8a5bd789a1c8cfae4ea1a6786d66986828442672b96030b45bc881bb30e8bcd513437396229f004ababe31c6b817b399f4cc23d9eb117
7
- data.tar.gz: 5bee681d6820d171c9a09c33da5ac3306e3583156748128684c88596d69159a5b4e1858a9a2adf3f90c68a24264cb6f1c06eb56750aaac4fcda4972e8e490fd0
6
+ metadata.gz: 6fee920794f68739c1e6d81c10503c2848cd87d39fe583bd4fd492d97a2cba41bfacdf5a0d6273d02fe11c607fb9e46e47d85ba40c33edff223d38cb8c98c461
7
+ data.tar.gz: e2bca218c41fc9221ed6184c20f1b4e861a9f4c54adb7aaf4573cbdf479bdfadc96ab629d24bf21aac3ede59a58852485b861c1f467e34365ddce54ceddfe011
@@ -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,50 +181,15 @@ 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:)
188
- return if skip_upload_changelogs
189
- return if version_codes.empty?
190
-
191
- UI.message("Updating listings for #{version_codes.length} version codes: #{version_codes.join(', ')}")
192
-
193
- # Get listings once with ETag
194
- listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings"
195
- listings_response = api_client.get(listings_path) do |request|
196
- request.headers['Authorization'] = "Bearer #{token}"
197
- end
198
- raise StandardError, listings_response.body unless listings_response.success?
199
-
200
- # Process each language once
201
- listings_response.body[:listings].each do |lang, listing|
202
- # Get fresh ETag for each language update to avoid conflicts
203
- etag_response = api_client.get(listings_path) do |request|
204
- request.headers['Authorization'] = "Bearer #{token}"
205
- end
206
- raise StandardError, etag_response.body unless etag_response.success?
207
-
208
- etag = etag_response.headers['Etag']
209
-
210
- # Find the best changelog for multiple version codes
211
- recent_changes = find_changelog_for_multiple_version_codes(
212
- language: listing[:language],
213
- version_codes: version_codes,
214
- metadata_path: metadata_path
215
- )
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?
184
+ def self.update_changelogs(app_id:, edit_id:, token:, version_codes:, skip_upload_changelogs:, metadata_path:)
185
+ # Use the highest version code's changelog (same as Fastlane's approach)
186
+ max_version_code = version_codes.max
187
+ if max_version_code.nil?
188
+ UI.message("Ensuring release notes placeholder is present...")
189
+ else
190
+ UI.message("Updating changelogs using highest version code: #{max_version_code}")
226
191
  end
227
- nil
228
- end
229
192
 
230
- def self.update_listings(app_id:, edit_id:, token:, version_code:, skip_upload_changelogs:, metadata_path:)
231
193
  listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings"
232
194
  listings_response = api_client.get(listings_path) do |request|
233
195
  request.headers['Authorization'] = "Bearer #{token}"
@@ -235,6 +197,11 @@ module Fastlane
235
197
  raise StandardError, listings_response.body unless listings_response.success?
236
198
 
237
199
  listings_response.body[:listings].each do |lang, listing|
200
+ # When only the "-" placeholder would be written, keep existing
201
+ # release notes untouched and fill it in only when they are missing.
202
+ next if (skip_upload_changelogs || max_version_code.nil?) && !listing[:recentChanges].to_s.strip.empty?
203
+
204
+ # Get fresh ETag for each language update to avoid conflicts
238
205
  etag_response = api_client.get(listings_path) do |request|
239
206
  request.headers['Authorization'] = "Bearer #{token}"
240
207
  end
@@ -242,13 +209,12 @@ module Fastlane
242
209
 
243
210
  etag = etag_response.headers['Etag']
244
211
 
245
- recent_changes = find_changelog(
212
+ listing[:recentChanges] = find_changelog(
246
213
  language: listing[:language],
247
- version_code: version_code,
214
+ version_code: max_version_code,
248
215
  skip_upload_changelogs: skip_upload_changelogs,
249
216
  metadata_path: metadata_path
250
217
  )
251
- listing[:recentChanges] = recent_changes
252
218
 
253
219
  update_listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings/#{lang}"
254
220
  update_listings_response = api_client.put(update_listings_path) do |request|
@@ -389,7 +355,7 @@ module Fastlane
389
355
  target_path = File.join(images_path, mapping)
390
356
 
391
357
  if File.directory?(target_path)
392
- Dir.glob(File.join(target_path, '*.{png,jpg,jpeg}')).sort
358
+ Dir.glob(File.join(target_path, '*.{png,jpg,jpeg}'))
393
359
  elsif File.exist?(target_path)
394
360
  [target_path]
395
361
  else
@@ -439,23 +405,11 @@ module Fastlane
439
405
  end
440
406
  private_class_method :auth_client
441
407
 
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
408
  def self.find_changelog(language:, version_code:, skip_upload_changelogs:, metadata_path:)
455
409
  # The Amazon appstore requires you to enter changelogs before reviewing.
456
410
  # Therefore, if there is no metadata, hyphen text is returned.
457
411
  changelog_text = '-'
458
- return changelog_text if skip_upload_changelogs
412
+ return changelog_text if skip_upload_changelogs || version_code.nil?
459
413
 
460
414
  path = File.join(metadata_path, language, 'changelogs', "#{version_code}.txt")
461
415
  if File.exist?(path) && !File.empty?(path)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AmazonAppstore
3
- VERSION = "1.5.0"
3
+ VERSION = "1.6.1"
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.1
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-07-02 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
@@ -215,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
215
  requirements:
216
216
  - - ">="
217
217
  - !ruby/object:Gem::Version
218
- version: '2.7'
218
+ version: '3.0'
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  requirements:
221
221
  - - ">="