fastlane-plugin-amazon_appstore 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +97 -0
- data/lib/fastlane/plugin/amazon_appstore/actions/upload_to_amazon_appstore_action.rb +156 -0
- data/lib/fastlane/plugin/amazon_appstore/helper/amazon_appstore_helper.rb +181 -0
- data/lib/fastlane/plugin/amazon_appstore/version.rb +5 -0
- data/lib/fastlane/plugin/amazon_appstore.rb +16 -0
- metadata +217 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8c7b408a3aaa0439606dad64da05a2e1e9304b2fbdff0f562e43ec9dc84f5dcf
|
4
|
+
data.tar.gz: 7a2be8428a7bdf1c48f74736d9d130e8dad6259e75c2b94ccd25704605072641
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5e1e17cec1f9042d853079cb6643460f58d62997b9102a6bd7f6923d2ed23628eaa1d35669803362b09eb27074bcd6aad513f64528540e91edbb1af841cd12f3
|
7
|
+
data.tar.gz: 7f2962dbfbb14d818cf5fefa4a1b427fe9e06c0ea909afcac74404b5a50eb74420e3fd2e8326d906ea0a0fb2a40bc1254dc3acd142312882969c023b0121ff02
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 ntsk <contact@ntsk.jp>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
# amazon_appstore `fastlane` plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-amazon_appstore)
|
4
|
+
![](https://github.com/ntsk/fastlane-plugin-amazon_appstore/actions/workflows/test.yml/badge.svg)
|
5
|
+
|
6
|
+
## Getting Started
|
7
|
+
|
8
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-amazon_appstore`, add it to your project by running:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
fastlane add_plugin amazon_appstore
|
12
|
+
```
|
13
|
+
|
14
|
+
## About amazon_appstore
|
15
|
+
|
16
|
+
Upload the apk to the Amazon Appstore using the [App Submission API](https://developer.amazon.com/docs/app-submission-api/overview.html).
|
17
|
+
|
18
|
+
In the future, it would be nice to be able to use it to update store information like `upload_to_play_store`, but for now, it only supports replacing apk and submitting it for review.
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
Following the [guide](https://developer.amazon.com/docs/app-submission-api/auth.html), you will need to generate `client_id` and `client_secret` to access the console in advance.
|
23
|
+
|
24
|
+
Call `upload_to_amazon_appstore` in your Fastfile.
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
upload_to_amazon_appstore(
|
28
|
+
apk: "app/build/outputs/apk/release/app-release.apk",
|
29
|
+
client_id: <YOUR_CLIENT_ID>,
|
30
|
+
client_secret: <YOUR_CLIENT_SECRET>
|
31
|
+
)
|
32
|
+
```
|
33
|
+
|
34
|
+
### Parameters
|
35
|
+
| Key | Description | Default |
|
36
|
+
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
|
37
|
+
| package_name | The package name of the application to use | * |
|
38
|
+
| apk | Path to the APK file to upload | |
|
39
|
+
| client_id | The client ID you saved | |
|
40
|
+
| client_secret | The client secret you saved | |
|
41
|
+
| skip_upload_changelogs | Whether to skip uploading changelogs | false |
|
42
|
+
| metadata_path | Path to the directory containing the metadata files | ./fastlane/metadata/android |
|
43
|
+
| changes_not_sent_for_reivew | 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
|
+
| timeout | Timeout for read, open (in seconds) | 300 |
|
45
|
+
* = default value is dependent on the user's system
|
46
|
+
|
47
|
+
### Changelogs
|
48
|
+
|
49
|
+
You can update the release notes by adding a file under `changelogs/` in the same way as [supply](https://docs.fastlane.tools/actions/upload_to_play_store/).
|
50
|
+
The filename should exactly match the version code of the APK that it represents. You can also provide default notes that will be used if no files match the version code by adding a default.txt file.
|
51
|
+
|
52
|
+
```
|
53
|
+
└── fastlane
|
54
|
+
└── metadata
|
55
|
+
└── android
|
56
|
+
├── en-US
|
57
|
+
│ └── changelogs
|
58
|
+
│ ├── default.txt
|
59
|
+
│ ├── 100000.txt
|
60
|
+
│ └── 100100.txt
|
61
|
+
└── fr-FR
|
62
|
+
└── changelogs
|
63
|
+
├── default.txt
|
64
|
+
└── 100100.txt
|
65
|
+
```
|
66
|
+
|
67
|
+
One difference from Google Play is that the Amazon Appstore always requires release notes to be entered before review.
|
68
|
+
For this reason, `-` will be entered by default if the corresponding changelogs file is not found, or if the `skip_upload_changelogs` parameter is used.
|
69
|
+
|
70
|
+
## Run tests for this plugin
|
71
|
+
|
72
|
+
To run both the tests, and code style validation, run
|
73
|
+
|
74
|
+
```
|
75
|
+
rake
|
76
|
+
```
|
77
|
+
|
78
|
+
To automatically fix many of the styling issues, use
|
79
|
+
```
|
80
|
+
rubocop -a
|
81
|
+
```
|
82
|
+
|
83
|
+
## Issues and Feedback
|
84
|
+
|
85
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
86
|
+
|
87
|
+
## Troubleshooting
|
88
|
+
|
89
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
90
|
+
|
91
|
+
## Using _fastlane_ Plugins
|
92
|
+
|
93
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
94
|
+
|
95
|
+
## About _fastlane_
|
96
|
+
|
97
|
+
_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).
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/amazon_appstore_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class UploadToAmazonAppstoreAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
Helper::AmazonAppstoreHelper.setup(
|
9
|
+
timeout: params[:timeout]
|
10
|
+
)
|
11
|
+
|
12
|
+
UI.message("Fetching access token...")
|
13
|
+
begin
|
14
|
+
token = Helper::AmazonAppstoreHelper.token(
|
15
|
+
client_id: params[:client_id],
|
16
|
+
client_secret: params[:client_secret]
|
17
|
+
)
|
18
|
+
rescue StandardError => e
|
19
|
+
UI.error(e.message)
|
20
|
+
UI.abort_with_message!("Failed to get token")
|
21
|
+
end
|
22
|
+
UI.abort_with_message!("Failed to get token") if token.nil?
|
23
|
+
|
24
|
+
UI.message("Creating new edits...")
|
25
|
+
begin
|
26
|
+
edit_id = Helper::AmazonAppstoreHelper.create_edits(
|
27
|
+
app_id: params[:package_name],
|
28
|
+
token: token
|
29
|
+
)
|
30
|
+
rescue StandardError => e
|
31
|
+
UI.error(e.message)
|
32
|
+
UI.abort_with_message!("Failed to create edits")
|
33
|
+
end
|
34
|
+
UI.abort_with_message!("Failed to get edit_id") if edit_id.nil?
|
35
|
+
|
36
|
+
UI.message("Replacing apk...")
|
37
|
+
begin
|
38
|
+
version_code = Helper::AmazonAppstoreHelper.replace_apk(
|
39
|
+
local_apk_path: params[:apk],
|
40
|
+
app_id: params[:package_name],
|
41
|
+
edit_id: edit_id,
|
42
|
+
token: token
|
43
|
+
)
|
44
|
+
rescue StandardError => e
|
45
|
+
UI.error(e.message)
|
46
|
+
UI.abort_with_message!("Failed to replace apk")
|
47
|
+
end
|
48
|
+
UI.abort_with_message!("Failed to get version_code") if version_code.nil?
|
49
|
+
|
50
|
+
UI.message("Updating release notes...")
|
51
|
+
begin
|
52
|
+
Helper::AmazonAppstoreHelper.update_listings(
|
53
|
+
app_id: params[:package_name],
|
54
|
+
edit_id: edit_id,
|
55
|
+
token: token,
|
56
|
+
version_code: version_code,
|
57
|
+
skip_upload_changelogs: params[:skip_upload_changelogs],
|
58
|
+
metadata_path: params[:metadata_path]
|
59
|
+
)
|
60
|
+
rescue StandardError => e
|
61
|
+
UI.error(e.message)
|
62
|
+
UI.abort_with_message!("Failed to update listings")
|
63
|
+
end
|
64
|
+
|
65
|
+
if params[:changes_not_sent_for_review]
|
66
|
+
UI.success('Successfully finished the upload to Amazon Appstore')
|
67
|
+
return
|
68
|
+
end
|
69
|
+
|
70
|
+
UI.message("Committing edits...")
|
71
|
+
begin
|
72
|
+
Helper::AmazonAppstoreHelper.commit_edits(
|
73
|
+
app_id: params[:package_name],
|
74
|
+
edit_id: edit_id,
|
75
|
+
token: token
|
76
|
+
)
|
77
|
+
rescue StandardError => e
|
78
|
+
UI.error(e.message)
|
79
|
+
UI.abort_with_message!("Failed to commit edits")
|
80
|
+
end
|
81
|
+
|
82
|
+
UI.success('Successfully finished the upload to Amazon Appstore')
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.description
|
86
|
+
"Upload apps to Amazon Appstore"
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.authors
|
90
|
+
["ntsk"]
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.return_value
|
94
|
+
# nothing
|
95
|
+
end
|
96
|
+
|
97
|
+
def self.details
|
98
|
+
"Upload apps to Amazon Appstore"
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.available_options
|
102
|
+
[
|
103
|
+
FastlaneCore::ConfigItem.new(key: :client_id,
|
104
|
+
env_name: "AMAZON_APPSTORE_CLIENT_ID",
|
105
|
+
description: "Your client id",
|
106
|
+
optional: false,
|
107
|
+
type: String),
|
108
|
+
FastlaneCore::ConfigItem.new(key: :client_secret,
|
109
|
+
env_name: "AMAZON_APPSTORE_CLIENT_SECRET",
|
110
|
+
description: "Your client secret",
|
111
|
+
optional: false,
|
112
|
+
type: String),
|
113
|
+
FastlaneCore::ConfigItem.new(key: :package_name,
|
114
|
+
env_name: "AMAZON_APPSTORE_PACKAGE_NAME",
|
115
|
+
description: "The package name of the application to use",
|
116
|
+
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:package_name),
|
117
|
+
default_value_dynamic: true,
|
118
|
+
type: String),
|
119
|
+
FastlaneCore::ConfigItem.new(key: :apk,
|
120
|
+
env_name: "AMAZON_APPSTORE_APK",
|
121
|
+
description: "The path of the apk file",
|
122
|
+
optional: false,
|
123
|
+
type: String),
|
124
|
+
FastlaneCore::ConfigItem.new(key: :skip_upload_changelogs,
|
125
|
+
env_name: "AMAZON_APPSTORE_SKIP_UPLOAD_CHANGELOGS",
|
126
|
+
description: "Whether to skip uploading changelogs",
|
127
|
+
default_value: false,
|
128
|
+
optional: true,
|
129
|
+
type: Boolean),
|
130
|
+
FastlaneCore::ConfigItem.new(key: :metadata_path,
|
131
|
+
env_name: "AMAZON_APPSTORE_METADATA_PATH",
|
132
|
+
description: "Path to the directory containing the metadata files",
|
133
|
+
default_value: "./fastlane/metadata/android",
|
134
|
+
optional: true,
|
135
|
+
type: String),
|
136
|
+
FastlaneCore::ConfigItem.new(key: :changes_not_sent_for_review,
|
137
|
+
env_name: "AMAZON_APPSTORE_CHANGES_NOT_SENT_FOR_REVIEW",
|
138
|
+
description: "Indices that the changes in this edit will not be reviewed until they are explicitly sent for review from the Amazon Appstore Console UI",
|
139
|
+
default_value: false,
|
140
|
+
optional: true,
|
141
|
+
type: Boolean),
|
142
|
+
FastlaneCore::ConfigItem.new(key: :timeout,
|
143
|
+
env_name: "AMAZON_APPSTORE_TIMEOUT",
|
144
|
+
description: "Timeout for read, open (in seconds)",
|
145
|
+
default_value: 300,
|
146
|
+
optional: true,
|
147
|
+
type: Integer)
|
148
|
+
]
|
149
|
+
end
|
150
|
+
|
151
|
+
def self.is_supported?(platform)
|
152
|
+
platform.equal?(:android)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
2
|
+
require 'faraday'
|
3
|
+
require 'faraday_middleware'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module Fastlane
|
7
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
|
8
|
+
|
9
|
+
module Helper
|
10
|
+
class AmazonAppstoreHelper
|
11
|
+
BASE_URL = 'https://developer.amazon.com'
|
12
|
+
AUTH_URL = 'https://api.amazon.com/auth/o2/token'
|
13
|
+
|
14
|
+
@api_client = nil
|
15
|
+
@timeout = nil
|
16
|
+
|
17
|
+
def self.setup(timeout:)
|
18
|
+
@timeout = timeout
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.token(client_id:, client_secret:)
|
22
|
+
grant_type = 'client_credentials'
|
23
|
+
scope = 'appstore::apps:readwrite'
|
24
|
+
data = {
|
25
|
+
grant_type: grant_type,
|
26
|
+
client_id: client_id,
|
27
|
+
client_secret: client_secret,
|
28
|
+
scope: scope
|
29
|
+
}
|
30
|
+
auth_response = auth_client.post do |request|
|
31
|
+
# without escaping
|
32
|
+
request.body = JSON.parse(data.to_json)
|
33
|
+
end
|
34
|
+
raise StandardError, auth_response.body unless auth_response.success?
|
35
|
+
|
36
|
+
auth_response.body[:access_token]
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.create_edits(app_id:, token:)
|
40
|
+
create_edits_response = api_client.post("api/appstore/v1/applications/#{app_id}/edits") do |request|
|
41
|
+
request.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
42
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
43
|
+
end
|
44
|
+
raise StandardError, create_edits_response.body unless create_edits_response.success?
|
45
|
+
|
46
|
+
create_edits_response.body[:id]
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.replace_apk(local_apk_path:, app_id:, edit_id:, token:)
|
50
|
+
get_apks_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/apks"
|
51
|
+
get_apks_response = api_client.get(get_apks_path) do |request|
|
52
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
53
|
+
end
|
54
|
+
raise StandardError, get_apks_response.body unless get_apks_response.success?
|
55
|
+
|
56
|
+
first_apk = get_apks_response.body[0]
|
57
|
+
apk_id = first_apk[:id]
|
58
|
+
raise StandardError, 'apk_id is nil' if apk_id.nil?
|
59
|
+
|
60
|
+
get_etag_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/apks/#{apk_id}"
|
61
|
+
etag_response = api_client.get(get_etag_path) do |request|
|
62
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
63
|
+
end
|
64
|
+
raise StandardError, etag_response.body unless etag_response.success?
|
65
|
+
|
66
|
+
etag = etag_response.headers['Etag']
|
67
|
+
|
68
|
+
replace_apk_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/apks/#{apk_id}/replace"
|
69
|
+
replace_apk_response = api_client.put(replace_apk_path) do |request|
|
70
|
+
request.body = Faraday::UploadIO.new(local_apk_path, 'application/vnd.android.package-archive')
|
71
|
+
request.headers['Content-Length'] = request.body.stat.size.to_s
|
72
|
+
request.headers['Content-Type'] = 'application/vnd.android.package-archive'
|
73
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
74
|
+
request.headers['If-Match'] = etag
|
75
|
+
end
|
76
|
+
raise StandardError, replace_apk_response.body unless replace_apk_response.success?
|
77
|
+
|
78
|
+
replace_apk_response.body[:versionCode]
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.update_listings(app_id:, edit_id:, token:, version_code:, skip_upload_changelogs:, metadata_path:)
|
82
|
+
listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings"
|
83
|
+
listings_response = api_client.get(listings_path) do |request|
|
84
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
85
|
+
end
|
86
|
+
raise StandardError, listings_response.body unless listings_response.success?
|
87
|
+
|
88
|
+
listings_response.body[:listings].each do |lang, listing|
|
89
|
+
etag_response = api_client.get(listings_path) do |request|
|
90
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
91
|
+
end
|
92
|
+
raise StandardError, etag_response.body unless etag_response.success?
|
93
|
+
|
94
|
+
etag = etag_response.headers['Etag']
|
95
|
+
|
96
|
+
recent_changes = find_changelog(
|
97
|
+
language: listing[:language],
|
98
|
+
version_code: version_code,
|
99
|
+
skip_upload_changelogs: skip_upload_changelogs,
|
100
|
+
metadata_path: metadata_path
|
101
|
+
)
|
102
|
+
listing[:recentChanges] = recent_changes
|
103
|
+
|
104
|
+
update_listings_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/listings/#{lang}"
|
105
|
+
update_listings_response = api_client.put(update_listings_path) do |request|
|
106
|
+
request.body = listing.to_json
|
107
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
108
|
+
request.headers['If-Match'] = etag
|
109
|
+
end
|
110
|
+
raise StandardError, update_listings_response.body unless update_listings_response.success?
|
111
|
+
end
|
112
|
+
nil
|
113
|
+
end
|
114
|
+
|
115
|
+
def self.commit_edits(app_id:, edit_id:, token:)
|
116
|
+
get_etag_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}"
|
117
|
+
etag_response = api_client.get(get_etag_path) do |request|
|
118
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
119
|
+
end
|
120
|
+
raise StandardError, etag_response.body unless etag_response.success?
|
121
|
+
|
122
|
+
etag = etag_response.headers['Etag']
|
123
|
+
|
124
|
+
commit_edits_path = "api/appstore/v1/applications/#{app_id}/edits/#{edit_id}/commit"
|
125
|
+
commit_edits_response = api_client.post(commit_edits_path) do |request|
|
126
|
+
request.headers['Authorization'] = "Bearer #{token}"
|
127
|
+
request.headers['If-Match'] = etag
|
128
|
+
end
|
129
|
+
raise StandardError, commit_edits_response.body unless commit_edits_response.success?
|
130
|
+
|
131
|
+
nil
|
132
|
+
end
|
133
|
+
|
134
|
+
def self.api_client
|
135
|
+
@api_client ||= Faraday.new(url: BASE_URL) do |builder|
|
136
|
+
builder.options.open_timeout = @timeout unless @timeout.nil?
|
137
|
+
builder.options.timeout = @timeout unless @timeout.nil?
|
138
|
+
builder.request(:multipart)
|
139
|
+
builder.request(:url_encoded)
|
140
|
+
builder.response(:json, parser_options: { symbolize_names: true })
|
141
|
+
builder.adapter(Faraday.default_adapter)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
private_class_method :api_client
|
145
|
+
|
146
|
+
def self.auth_client
|
147
|
+
Faraday.new(url: AUTH_URL) do |builder|
|
148
|
+
builder.options.open_timeout = @timeout unless @timeout.nil?
|
149
|
+
builder.options.timeout = @timeout unless @timeout.nil?
|
150
|
+
builder.request(:url_encoded)
|
151
|
+
builder.response(:json, parser_options: { symbolize_names: true })
|
152
|
+
builder.adapter(Faraday.default_adapter)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
private_class_method :auth_client
|
156
|
+
|
157
|
+
def self.find_changelog(language:, version_code:, skip_upload_changelogs:, metadata_path:)
|
158
|
+
# The Amazon appstore requires you to enter changelogs before reviewing.
|
159
|
+
# Therefore, if there is no metadata, hyphen text is returned.
|
160
|
+
changelog_text = '-'
|
161
|
+
return changelog_text if skip_upload_changelogs
|
162
|
+
|
163
|
+
path = File.join(metadata_path, language, 'changelogs', "#{version_code}.txt")
|
164
|
+
if File.exist?(path) && !File.zero?(path)
|
165
|
+
UI.message("Updating changelog for '#{version_code}' and language '#{language}'...")
|
166
|
+
changelog_text = File.read(path, encoding: 'UTF-8')
|
167
|
+
else
|
168
|
+
defalut_changelog_path = File.join(metadata_path, language, 'changelogs', 'default.txt')
|
169
|
+
if File.exist?(defalut_changelog_path) && !File.zero?(defalut_changelog_path)
|
170
|
+
UI.message("Updating changelog for '#{version_code}' and language '#{language}' to default changelog...")
|
171
|
+
changelog_text = File.read(defalut_changelog_path, encoding: 'UTF-8')
|
172
|
+
else
|
173
|
+
UI.message("Could not find changelog for '#{version_code}' and language '#{language}' at path #{path}...")
|
174
|
+
end
|
175
|
+
end
|
176
|
+
changelog_text
|
177
|
+
end
|
178
|
+
private_class_method :find_changelog
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/amazon_appstore/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module AmazonAppstore
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::AmazonAppstore.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-amazon_appstore
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ntsk
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fastlane
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.199.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.199.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec_junit_formatter
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.25.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.25.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-performance
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop-require_tools
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: simplecov
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
description:
|
182
|
+
email: contact@ntsk.jp
|
183
|
+
executables: []
|
184
|
+
extensions: []
|
185
|
+
extra_rdoc_files: []
|
186
|
+
files:
|
187
|
+
- LICENSE
|
188
|
+
- README.md
|
189
|
+
- lib/fastlane/plugin/amazon_appstore.rb
|
190
|
+
- lib/fastlane/plugin/amazon_appstore/actions/upload_to_amazon_appstore_action.rb
|
191
|
+
- lib/fastlane/plugin/amazon_appstore/helper/amazon_appstore_helper.rb
|
192
|
+
- lib/fastlane/plugin/amazon_appstore/version.rb
|
193
|
+
homepage: https://github.com/ntsk/fastlane-plugin-amazon_appstore
|
194
|
+
licenses:
|
195
|
+
- MIT
|
196
|
+
metadata:
|
197
|
+
rubygems_mfa_required: 'true'
|
198
|
+
post_install_message:
|
199
|
+
rdoc_options: []
|
200
|
+
require_paths:
|
201
|
+
- lib
|
202
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - ">="
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '2.5'
|
207
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - ">="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '0'
|
212
|
+
requirements: []
|
213
|
+
rubygems_version: 3.3.3
|
214
|
+
signing_key:
|
215
|
+
specification_version: 4
|
216
|
+
summary: Upload apps to Amazon Appstore
|
217
|
+
test_files: []
|