Skip to content

Commit 0ff2495

Browse files
authored
Feature: Support adding localized version info when submittion app to App Store review (codemagic-ci-cd#172)
* Add AppStoreVersionLocalization model description * Add action group to work with localized App Store Version informations * Generate docs for App Store Version Localization actions * Add possibility to set App Store Version info using values from JSON * Unify formatting in AbstractBaseAction and add references to implementing functions * Remove type: ignore comments * Use Locale type for app's primaryLocale * Support setting localized App Store version metadata * Update docs * Update docs * Update docs * Fix docs * Fix test_publish_action_app_store_submit * Fix example JSON object formatting in markdown docs * Make localized App Store version arguments optional * Do not publish notes for first release * Fix types * Fix errors on invalid arguments * Fix type for localization locale * Improve logging for creating and updating localization information * Expose AppStoreVersionInfo and AppStoreVersionLocalizationInfo as public models * Fix test_invalid_private_key_from_file * Add missing method docstring * Add changelog * Update changelog and rename method
1 parent eb59b65 commit 0ff2495

40 files changed

+2018
-216
lines changed

Diff for: CHANGELOG.md

+55-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
1+
Version 0.13.1
2+
-------------
3+
4+
This is an enhancement release to further streamline the App Store review submission automation capabilities.
5+
6+
Additions and changes from [pull request #172](https://github.com/codemagic-ci-cd/cli-tools/pull/172).
7+
8+
**Features**
9+
- Support setting localized meta information for App Store versions when submitting build to App Store review.
10+
- Add new actions group `app-store-version-localizations` to `app-store-connect`.
11+
- Add new action `app-store-connect app-store-version-localizations create` to add localized metadata to an App Store version.
12+
- Add new action `app-store-connect app-store-version-localizations delete` to remove localized metadata from an App Store version.
13+
- Add new action `app-store-connect app-store-version-localizations get` to read App Store version localized metadata.
14+
- Add new action `app-store-connect app-store-version-localizations modify` to edit App Store version localized metadata.
15+
- Add new action `app-store-connect app-store-versions localizations` to list App Store version localizations for an App Store version.
16+
- Change `app-store-connect publish` to support adding or updating localized version metadata when submitting build to App Store review.
17+
- Change `app-store-connect builds submit-to-app-store` to support adding or updating localized version metadata for App Store version.
18+
- Add new App Store Connect API client method `AppStoreVersionLocalizations.create` to create App Store version localization meta information. See official API method [documentation](https://developer.apple.com/documentation/appstoreconnectapi/create_an_app_store_version_localization).
19+
- Add new App Store Connect API client method `AppStoreVersionLocalizations.read` to obtain App Store version localization meta information. See official API method [documentation](https://developer.apple.com/documentation/appstoreconnectapi/read_app_store_version_localization_information).
20+
- Add new App Store Connect API client method `AppStoreVersionLocalizations.modify` to edit existing App Store version localization meta information. See official API method [documentation](https://developer.apple.com/documentation/appstoreconnectapi/modify_an_app_store_version_localization).
21+
- Add new App Store Connect API client method `AppStoreVersionLocalizations.delete` to remove existing App Store version localization meta information. See official API method [documentation](https://developer.apple.com/documentation/appstoreconnectapi/delete_an_app_store_version_localization).
22+
- Add new App Store Connect API client method `AppStoreVersions.list_app_store_version_localizations` to list all App Store version localizations for given App Store version. See official API method [documentation](https://developer.apple.com/documentation/appstoreconnectapi/list_all_app_store_version_localizations_for_an_app_store_version).
23+
- Show more informative error messages in case CLI arguments from environment variables or files are invalid.
24+
- Add new options to actions `app-store-connect publish` and `app-store-connect builds submit-to-app-store`:
25+
- `--app-store-version-info`,
26+
- `--description`,
27+
- `--keywords`,
28+
- `--marketing-url`,
29+
- `--promotional-text`,
30+
- `--support-url`,
31+
- `--app-store-version-localizations`.
32+
33+
**Docs**
34+
35+
- Create docs for `app-store-connect` actions group `app-store-version-localizations`.
36+
- Create docs for action `app-store-connect app-store-version-localizations create`.
37+
- Create docs for action `app-store-connect app-store-version-localizations delete`.
38+
- Create docs for action `app-store-connect app-store-version-localizations get`.
39+
- Create docs for action `app-store-connect app-store-version-localizations modify`.
40+
- Update docs for `app-store-connect` actions group `app-store-versions`.
41+
- Create docs for action `app-store-connect app-store-versions localizations`.
42+
- Update docs for action `app-store-connect app-store-versions create`.
43+
- Update docs for action `app-store-connect app-store-versions modify`.
44+
- Update docs for action `app-store-connect builds submit-to-app-store`.
45+
- Update docs for action `app-store-connect publish`.
46+
- Remove backticks from terminal help messages and keep them only for markdown documentation formatting.
47+
48+
**Development**
49+
50+
- Add option to limit number of responses in App Store Connect API client pagination method.
51+
- Change type of `App.Attributes.locale` from plain `str` to `Locale` enumeration.
52+
- Add definition for `AppStoreVersionLocalization` resource. See official resource [documentation](https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionlocalization).
53+
- Reorder method signatures in `AbstractBaseAction` and unify indentation for method arguments.
54+
- Add references to implementing methods to `AbstractBaseAction` interface.
55+
156
Version 0.13.0
257
-------------
358

@@ -25,7 +80,6 @@ Additions and changes from [pull request #164](https://github.com/codemagic-ci-c
2580
- `-su` for `--skip-package-upload`,
2681
- `-sv` for `--skip-package-validation`,
2782
- `-w` for `--max-build-processing-wait`.
28-
-
2983

3084
**Fixes**
3185

Diff for: doc.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ def __init__(self, raw_arguments):
7272
@classmethod
7373
def _replace_quotes(cls, description: str) -> str:
7474
json_array = re.compile(r'"(\[[^\]]+\])"')
75-
# Dummy handling for description containing JSON arrays as an example
76-
if not json_array.search(description):
77-
return description.replace('"', '`')
78-
79-
before, array, after = json_array.split(description)
80-
before = before.replace('"', '`')
81-
after = after.replace('"', '`')
82-
return f'{before}`{array}`{after}'
75+
json_object = re.compile(r'"(\{[^\}]+\})"')
76+
# Dummy handling for description containing JSON arrays and objects as an example
77+
for patt in (json_object, json_array):
78+
if not patt.search(description):
79+
continue
80+
before, obj, after = patt.split(description)
81+
before = before.replace('"', '`')
82+
after = after.replace('"', '`')
83+
return f'{before}`{obj}`{after}'
84+
return description.replace('"', '`')
8385

8486
def _serialize_argument(self, arg) -> SerializedArgument:
8587
description = str_plain(arg._value_.description)

Diff for: docs/app-store-connect/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Enable verbose logging for commands
101101

102102
|Action group|Description|
103103
| :--- | :--- |
104+
|[`app-store-version-localizations`](app-store-version-localizations.md)|Create and maintain version-specific App Store metadata that is localized.|
104105
|[`app-store-version-submissions`](app-store-version-submissions.md)|Manage your application's App Store version review process|
105106
|[`app-store-versions`](app-store-versions.md)|Manage the information related to an App Store version of your app|
106107
|[`apps`](apps.md)|Manage your apps in App Store Connect|
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
2+
app-store-version-localizations
3+
===============================
4+
5+
6+
**Create and maintain version-specific App Store metadata that is localized.**
7+
### Usage
8+
```bash
9+
app-store-connect app-store-version-localizations [-h] [--log-stream STREAM] [--no-color] [--version] [-s] [-v]
10+
[--log-api-calls]
11+
[--json]
12+
[--issuer-id ISSUER_ID]
13+
[--key-id KEY_IDENTIFIER]
14+
[--private-key PRIVATE_KEY]
15+
[--certificates-dir CERTIFICATES_DIRECTORY]
16+
[--profiles-dir PROFILES_DIRECTORY]
17+
ACTION
18+
```
19+
### Optional arguments for command `app-store-connect`
20+
21+
##### `--log-api-calls`
22+
23+
24+
Turn on logging for App Store Connect API HTTP requests
25+
##### `--json`
26+
27+
28+
Whether to show the resource in JSON format
29+
##### `--issuer-id=ISSUER_ID`
30+
31+
32+
App Store Connect API Key Issuer ID. Identifies the issuer who created the authentication token. Learn more at https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api. If not given, the value will be checked from the environment variable `APP_STORE_CONNECT_ISSUER_ID`. Alternatively to entering `ISSUER_ID` in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
33+
##### `--key-id=KEY_IDENTIFIER`
34+
35+
36+
App Store Connect API Key ID. Learn more at https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api. If not given, the value will be checked from the environment variable `APP_STORE_CONNECT_KEY_IDENTIFIER`. Alternatively to entering `KEY_IDENTIFIER` in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
37+
##### `--private-key=PRIVATE_KEY`
38+
39+
40+
App Store Connect API private key used for JWT authentication to communicate with Apple services. Learn more at https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api. If not provided, the key will be searched from the following directories in sequence for a private key file with the name `AuthKey_<key_identifier>.p8`: private_keys, ~/private_keys, ~/.private_keys, ~/.appstoreconnect/private_keys, where <key_identifier> is the value of --key-id. If not given, the value will be checked from the environment variable `APP_STORE_CONNECT_PRIVATE_KEY`. Alternatively to entering `PRIVATE_KEY` in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
41+
##### `--certificates-dir=CERTIFICATES_DIRECTORY`
42+
43+
44+
Directory where the code signing certificates will be saved. Default:&nbsp;`$HOME/Library/MobileDevice/Certificates`
45+
##### `--profiles-dir=PROFILES_DIRECTORY`
46+
47+
48+
Directory where the provisioning profiles will be saved. Default:&nbsp;`$HOME/Library/MobileDevice/Provisioning Profiles`
49+
### Common options
50+
51+
##### `-h, --help`
52+
53+
54+
show this help message and exit
55+
##### `--log-stream=stderr | stdout`
56+
57+
58+
Log output stream. Default `stderr`
59+
##### `--no-color`
60+
61+
62+
Do not use ANSI colors to format terminal output
63+
##### `--version`
64+
65+
66+
Show tool version and exit
67+
##### `-s, --silent`
68+
69+
70+
Disable log output for commands
71+
##### `-v, --verbose`
72+
73+
74+
Enable verbose logging for commands
75+
### Actions
76+
77+
|Action|Description|
78+
| :--- | :--- |
79+
|[`create`](app-store-version-localizations/create.md)|Create an App Store Version Localization. Add localized version-level information for a new locale.|
80+
|[`delete`](app-store-version-localizations/delete.md)|Delete an App Store Version Localization. Remove a language from your version metadata.|
81+
|[`get`](app-store-version-localizations/get.md)|Read App Store Version Localization Information. Get localized version-level information.|
82+
|[`modify`](app-store-version-localizations/modify.md)|Modify an App Store Version Localization. Edit localized version-level information for a particular language.|
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
2+
create
3+
======
4+
5+
6+
**Create an App Store Version Localization. Add localized version-level information for a new locale.**
7+
### Usage
8+
```bash
9+
app-store-connect app-store-version-localizations create [-h] [--log-stream STREAM] [--no-color] [--version] [-s] [-v]
10+
[--log-api-calls]
11+
[--json]
12+
[--issuer-id ISSUER_ID]
13+
[--key-id KEY_IDENTIFIER]
14+
[--private-key PRIVATE_KEY]
15+
[--certificates-dir CERTIFICATES_DIRECTORY]
16+
[--profiles-dir PROFILES_DIRECTORY]
17+
[--description DESCRIPTION]
18+
[--keywords KEYWORDS]
19+
[--marketing-url MARKETING_URL]
20+
[--promotional-text PROMOTIONAL_TEXT]
21+
[--support-url SUPPORT_URL]
22+
[--whats-new WHATS_NEW]
23+
APP_STORE_VERSION_ID
24+
LOCALE
25+
```
26+
### Required arguments for action `create`
27+
28+
##### `APP_STORE_VERSION_ID`
29+
30+
31+
UUID value of the App Store Version
32+
##### `LOCALE`
33+
34+
35+
The locale code name for App Store metadata in different languages. See available locale code names from https://developer.apple.com/documentation/appstoreconnectapi/betabuildlocalizationcreaterequest/data/attributes
36+
### Optional arguments for action `create`
37+
38+
##### `--description, -d=DESCRIPTION`
39+
40+
41+
A description of your app, detailing features and functionality.
42+
##### `--keywords, -k=KEYWORDS`
43+
44+
45+
Include one or more keywords that describe your app. Keywords make App Store search results more accurate. Separate keywords with an English comma, Chinese comma, or a mix of both.
46+
##### `--marketing-url=MARKETING_URL`
47+
48+
49+
A URL with marketing information about your app. This URL will be visible on the App Store.
50+
##### `--promotional-text=PROMOTIONAL_TEXT`
51+
52+
53+
Promotional text lets you inform your App Store visitors of any current app features without requiring an updated submission. This text will appear above your description on the App Store for customers with devices running iOS 11 or later, and macOS 10.13 or later.
54+
##### `--support-url=SUPPORT_URL`
55+
56+
57+
A URL with support information for your app. This URL will be visible on the App Store.
58+
##### `--whats-new, -n=WHATS_NEW`
59+
60+
61+
Describe what's new in this version of your app, such as new features, improvements, and bug fixes. If not given, the value will be checked from the environment variable `APP_STORE_CONNECT_WHATS_NEW`. Alternatively to entering `WHATS_NEW` in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
62+
### Optional arguments for command `app-store-connect`
63+
64+
##### `--log-api-calls`
65+
66+
67+
Turn on logging for App Store Connect API HTTP requests
68+
##### `--json`
69+
70+
71+
Whether to show the resource in JSON format
72+
##### `--issuer-id=ISSUER_ID`
73+
74+
75+
App Store Connect API Key Issuer ID. Identifies the issuer who created the authentication token. Learn more at https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api. If not given, the value will be checked from the environment variable `APP_STORE_CONNECT_ISSUER_ID`. Alternatively to entering `ISSUER_ID` in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
76+
##### `--key-id=KEY_IDENTIFIER`
77+
78+
79+
App Store Connect API Key ID. Learn more at https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api. If not given, the value will be checked from the environment variable `APP_STORE_CONNECT_KEY_IDENTIFIER`. Alternatively to entering `KEY_IDENTIFIER` in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
80+
##### `--private-key=PRIVATE_KEY`
81+
82+
83+
App Store Connect API private key used for JWT authentication to communicate with Apple services. Learn more at https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api. If not provided, the key will be searched from the following directories in sequence for a private key file with the name `AuthKey_<key_identifier>.p8`: private_keys, ~/private_keys, ~/.private_keys, ~/.appstoreconnect/private_keys, where <key_identifier> is the value of --key-id. If not given, the value will be checked from the environment variable `APP_STORE_CONNECT_PRIVATE_KEY`. Alternatively to entering `PRIVATE_KEY` in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
84+
##### `--certificates-dir=CERTIFICATES_DIRECTORY`
85+
86+
87+
Directory where the code signing certificates will be saved. Default:&nbsp;`$HOME/Library/MobileDevice/Certificates`
88+
##### `--profiles-dir=PROFILES_DIRECTORY`
89+
90+
91+
Directory where the provisioning profiles will be saved. Default:&nbsp;`$HOME/Library/MobileDevice/Provisioning Profiles`
92+
### Common options
93+
94+
##### `-h, --help`
95+
96+
97+
show this help message and exit
98+
##### `--log-stream=stderr | stdout`
99+
100+
101+
Log output stream. Default `stderr`
102+
##### `--no-color`
103+
104+
105+
Do not use ANSI colors to format terminal output
106+
##### `--version`
107+
108+
109+
Show tool version and exit
110+
##### `-s, --silent`
111+
112+
113+
Disable log output for commands
114+
##### `-v, --verbose`
115+
116+
117+
Enable verbose logging for commands

0 commit comments

Comments
 (0)