fastlane-plugin-amazon_appstore 0.1.0 → 1.1.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:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: eda405ecfd4552721a5fad15738d20f2923b56007d2bf902f0777675bf407e66
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e14898796f4aa0effa8e460adeaebb85bb3a2987db1695110ab505d9cd7ad60a
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: fe5a72a6bd0931931f8c7d3a0e2e25a80d487d7a370489fbf8f370c358882c4a225d48c38bdb8130c4bb62b2ebdbf4c299bb08b6b7b90c3086a1e132ee1a7c63
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f3768bf3ffe9364a0f922b7756452c547b365ab8a2e5d57a78980ecc628cf4afb5cf6ec3cf620a25b0d09db34277a4d13996c624282d092d7a3539afdd08d4bc
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -40,7 +40,8 @@ upload_to_amazon_appstore( 
     | 
|
| 
       40 
40 
     | 
    
         
             
            | client_secret               | The client secret you saved                                                                                                                |                             | 
         
     | 
| 
       41 
41 
     | 
    
         
             
            | skip_upload_changelogs      | Whether to skip uploading changelogs                                                                                                       | false                       | 
         
     | 
| 
       42 
42 
     | 
    
         
             
            | metadata_path               | Path to the directory containing the metadata files                                                                                        | ./fastlane/metadata/android | 
         
     | 
| 
       43 
     | 
    
         
            -
            |  
     | 
| 
      
 43 
     | 
    
         
            +
            | changes_not_sent_for_review | Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Amazon Appstore Console UI | false                       | 
         
     | 
| 
      
 44 
     | 
    
         
            +
            | overwrite_upload            | Whether to allow overwriting an existing upload                                                                                            | false                       |
         
     | 
| 
       44 
45 
     | 
    
         
             
            | timeout                     | Timeout for read, open (in seconds)                                                                                                        | 300                         | 
         
     | 
| 
       45 
46 
     | 
    
         
             
            * = default value is dependent on the user's system
         
     | 
| 
       46 
47 
     | 
    
         | 
| 
         @@ -4,7 +4,7 @@ require_relative '../helper/amazon_appstore_helper' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            module Fastlane
         
     | 
| 
       5 
5 
     | 
    
         
             
              module Actions
         
     | 
| 
       6 
6 
     | 
    
         
             
                class UploadToAmazonAppstoreAction < Action
         
     | 
| 
       7 
     | 
    
         
            -
                  def self.run(params)
         
     | 
| 
      
 7 
     | 
    
         
            +
                  def self.run(params) # rubocop:disable Metrics/PerceivedComplexity
         
     | 
| 
       8 
8 
     | 
    
         
             
                    Helper::AmazonAppstoreHelper.setup(
         
     | 
| 
       9 
9 
     | 
    
         
             
                      timeout: params[:timeout]
         
     | 
| 
       10 
10 
     | 
    
         
             
                    )
         
     | 
| 
         @@ -21,6 +21,19 @@ module Fastlane 
     | 
|
| 
       21 
21 
     | 
    
         
             
                    end
         
     | 
| 
       22 
22 
     | 
    
         
             
                    UI.abort_with_message!("Failed to get token") if token.nil?
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
      
 24 
     | 
    
         
            +
                    if params[:overwrite_upload]
         
     | 
| 
      
 25 
     | 
    
         
            +
                      UI.message("Deleting existing edits if needed (overwrite_upload: true)...")
         
     | 
| 
      
 26 
     | 
    
         
            +
                      begin
         
     | 
| 
      
 27 
     | 
    
         
            +
                        Helper::AmazonAppstoreHelper.delete_edits_if_exists(
         
     | 
| 
      
 28 
     | 
    
         
            +
                          app_id: params[:package_name],
         
     | 
| 
      
 29 
     | 
    
         
            +
                          token: token
         
     | 
| 
      
 30 
     | 
    
         
            +
                        )
         
     | 
| 
      
 31 
     | 
    
         
            +
                      rescue StandardError => e
         
     | 
| 
      
 32 
     | 
    
         
            +
                        UI.error(e.message)
         
     | 
| 
      
 33 
     | 
    
         
            +
                        UI.abort_with_message!("Failed to delete edits (overwrite_upload: true)")
         
     | 
| 
      
 34 
     | 
    
         
            +
                      end
         
     | 
| 
      
 35 
     | 
    
         
            +
                    end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
       24 
37 
     | 
    
         
             
                    UI.message("Creating new edits...")
         
     | 
| 
       25 
38 
     | 
    
         
             
                    begin
         
     | 
| 
       26 
39 
     | 
    
         
             
                      edit_id = Helper::AmazonAppstoreHelper.create_edits(
         
     | 
| 
         @@ -139,6 +152,12 @@ module Fastlane 
     | 
|
| 
       139 
152 
     | 
    
         
             
                                                   default_value: false,
         
     | 
| 
       140 
153 
     | 
    
         
             
                                                   optional: true,
         
     | 
| 
       141 
154 
     | 
    
         
             
                                                   type: Boolean),
         
     | 
| 
      
 155 
     | 
    
         
            +
                      FastlaneCore::ConfigItem.new(key: :overwrite_upload,
         
     | 
| 
      
 156 
     | 
    
         
            +
                                                   env_name: "AMAZON_APPSTORE_OVERWRITE_UPLOAD",
         
     | 
| 
      
 157 
     | 
    
         
            +
                                                   description: "Whether to allow overwriting an existing upload",
         
     | 
| 
      
 158 
     | 
    
         
            +
                                                   default_value: false,
         
     | 
| 
      
 159 
     | 
    
         
            +
                                                   optional: true,
         
     | 
| 
      
 160 
     | 
    
         
            +
                                                   type: Boolean),
         
     | 
| 
       142 
161 
     | 
    
         
             
                      FastlaneCore::ConfigItem.new(key: :timeout,
         
     | 
| 
       143 
162 
     | 
    
         
             
                                                   env_name: "AMAZON_APPSTORE_TIMEOUT",
         
     | 
| 
       144 
163 
     | 
    
         
             
                                                   description: "Timeout for read, open (in seconds)",
         
     | 
| 
         @@ -46,6 +46,25 @@ module Fastlane 
     | 
|
| 
       46 
46 
     | 
    
         
             
                    create_edits_response.body[:id]
         
     | 
| 
       47 
47 
     | 
    
         
             
                  end
         
     | 
| 
       48 
48 
     | 
    
         | 
| 
      
 49 
     | 
    
         
            +
                  def self.delete_edits_if_exists(app_id:, token:)
         
     | 
| 
      
 50 
     | 
    
         
            +
                    edits_path = "api/appstore/v1/applications/#{app_id}/edits"
         
     | 
| 
      
 51 
     | 
    
         
            +
                    edits_response = api_client.get(edits_path) do |request|
         
     | 
| 
      
 52 
     | 
    
         
            +
                      request.headers['Authorization'] = "Bearer #{token}"
         
     | 
| 
      
 53 
     | 
    
         
            +
                    end
         
     | 
| 
      
 54 
     | 
    
         
            +
                    raise StandardError, edits_response.body unless edits_response.success?
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                    edits_id = edits_response.body[:id]
         
     | 
| 
      
 57 
     | 
    
         
            +
                    etag = edits_response.headers['Etag']
         
     | 
| 
      
 58 
     | 
    
         
            +
                    return nil if edits_id.nil? || etag.nil? # Do nothing if edits do not exist
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                    delete_edits_response = api_client.delete("#{edits_path}/#{edits_id}") do |request|
         
     | 
| 
      
 61 
     | 
    
         
            +
                      request.headers['Authorization'] = "Bearer #{token}"
         
     | 
| 
      
 62 
     | 
    
         
            +
                      request.headers['If-Match'] = etag
         
     | 
| 
      
 63 
     | 
    
         
            +
                    end
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                    raise StandardError, delete_edits_response.body unless delete_edits_response.success?
         
     | 
| 
      
 66 
     | 
    
         
            +
                  end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
       49 
68 
     | 
    
         
             
                  def self.replace_apk(local_apk_path:, app_id:, edit_id:, token:)
         
     | 
| 
       50 
69 
     | 
    
         
             
                    get_apks_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/apks"
         
     | 
| 
       51 
70 
     | 
    
         
             
                    get_apks_response = api_client.get(get_apks_path) do |request|
         
     | 
    
        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:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - ntsk
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-03-23 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: faraday
         
     | 
| 
         @@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       210 
210 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       211 
211 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       212 
212 
     | 
    
         
             
            requirements: []
         
     | 
| 
       213 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 213 
     | 
    
         
            +
            rubygems_version: 3.5.9
         
     | 
| 
       214 
214 
     | 
    
         
             
            signing_key:
         
     | 
| 
       215 
215 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       216 
216 
     | 
    
         
             
            summary: Upload apps to Amazon Appstore
         
     |