blob: 902e517c7432839ac94a9d27ffcc80a908ba3ea3 [file] [log] [blame]
Søren Gjessee6087bf2023-01-17 10:49:29 +01001#!/usr/bin/env python3
2# Copyright (c) 2023, the R8 project authors. Please see the AUTHORS file
3# for details. All rights reserved. Use of this source code is governed by a
4# BSD-style license that can be found in the LICENSE file.
5
6import argparse
7import sys
8
9import gmaven
Søren Gjessedf3cd962023-01-30 11:22:05 +010010import utils
Søren Gjessee6087bf2023-01-17 10:49:29 +010011
12ARCHIVE_BUCKET = 'r8-releases'
13REPO = 'https://github.com/google/smali'
14
15def parse_options():
16 result = argparse.ArgumentParser(description='Release Smali')
17 result.add_argument('--version',
18 required=True,
19 metavar=('<version>'),
20 help='The version of smali to release.')
21 result.add_argument('--dry-run',
22 default=False,
23 action='store_true',
24 help='Only perform non-commiting tasks and print others.')
25 return result.parse_args()
26
27
28def Main():
29 options = parse_options()
Søren Gjessedf3cd962023-01-30 11:22:05 +010030 utils.check_gcert()
Søren Gjessee6087bf2023-01-17 10:49:29 +010031 gfile = ('/bigstore/r8-releases/smali/%s/smali-maven-release-%s.zip'
32 % (options.version, options.version))
33 release_id = gmaven.publisher_stage([gfile], options.dry_run)
34
35 print('Staged Release ID %s.\n' % release_id)
36 gmaven.publisher_stage_redir_test_info(
37 release_id, 'com.android.tools.smali:smali:%s' % options.version, 'smali.jar')
38
39 print()
40 answer = input('Continue with publishing [y/N]:')
41
42 if answer != 'y':
43 print('Aborting release to Google maven')
44 sys.exit(1)
45
46 gmaven.publisher_publish(release_id, options.dry_run)
47
48 print()
49 print('Published. Use the email workflow for approval.')
50
51if __name__ == '__main__':
52 sys.exit(Main())