Søren Gjesse | e6087bf | 2023-01-17 10:49:29 +0100 | [diff] [blame] | 1 | #!/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 | |
| 6 | import argparse |
| 7 | import sys |
| 8 | |
| 9 | import gmaven |
Søren Gjesse | df3cd96 | 2023-01-30 11:22:05 +0100 | [diff] [blame] | 10 | import utils |
Søren Gjesse | e6087bf | 2023-01-17 10:49:29 +0100 | [diff] [blame] | 11 | |
| 12 | ARCHIVE_BUCKET = 'r8-releases' |
| 13 | REPO = 'https://github.com/google/smali' |
| 14 | |
| 15 | def 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 | |
| 28 | def Main(): |
| 29 | options = parse_options() |
Søren Gjesse | df3cd96 | 2023-01-30 11:22:05 +0100 | [diff] [blame] | 30 | utils.check_gcert() |
Søren Gjesse | e6087bf | 2023-01-17 10:49:29 +0100 | [diff] [blame] | 31 | 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 | |
| 51 | if __name__ == '__main__': |
| 52 | sys.exit(Main()) |