Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting release notes #3

Merged
merged 3 commits into from Aug 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 17 additions & 1 deletion main.py
Expand Up @@ -13,12 +13,27 @@ def main():
parser.add_argument('aab_file', type=str, help='Path of the Android App Bundle file')
parser.add_argument('track', choices=['production', 'alpha', 'beta', 'internal'], default='internal',
help='Track to upload the apk to')
parser.add_argument(
'--release-notes', '-n',
type=str,
nargs=2,
action='append',
default=[],
help='''
User-facing notes for the release in the specified language,
e.g. "--release-notes en-US 'Bug fixes and performance improvements.'".
Can be specified multiple times for multiple languages.
For language codes see https://support.google.com/googleplay/android-developer/table/4419860
''',
metavar=('LANGUAGE', 'TEXT')
)
args = parser.parse_args()

service_account_file = args.service_account_file
package_name = args.package_name
app_bundle_file = args.aab_file
track = args.track
release_notes = [{"language": note[0], "text": note[1]} for note in args.release_notes]

# Load credentials
credentials = ServiceAccountCredentials.from_json_keyfile_name(
Expand Down Expand Up @@ -49,7 +64,8 @@ def main():
body={
'releases': [{
'versionCodes': [aab_response['versionCode']],
'status': 'completed'
'status': 'completed',
'releaseNotes': release_notes,
}]
}).execute()
print('Track {} is set for version code(s) {}'.format(track, track_response['releases']))
Expand Down