|
23 | 23 | logging.basicConfig(level=logging.INFO) |
24 | 24 |
|
25 | 25 | parser = argparse.ArgumentParser() |
26 | | -parser.add_argument("assets", nargs="+") |
| 26 | +parser.add_argument("assets", nargs="*") |
27 | 27 | parser.add_argument("--owner", required=True) |
28 | 28 | parser.add_argument("--project", required=True) |
29 | 29 | parser.add_argument("--tag", required=True) |
| 30 | +parser.add_argument("--release-id", help="Tag name without prefix and suffix") |
30 | 31 | parser.add_argument("--name", required=True) |
31 | 32 | parser.add_argument("--description", default="") |
32 | 33 | parser.add_argument("--md5sum-file", help="File with md5sums for uploaded assets") |
|
36 | 37 |
|
37 | 38 | args = parser.parse_args() |
38 | 39 |
|
| 40 | +# Download table. |
| 41 | +if args.release_id is not None: |
| 42 | + url = "//github.com/{0}/{1}/releases/download/{2}".format(args.owner, args.project, args.tag) |
| 43 | + fformat = "[{t}](" + url + "/arc_gnu_{release}_prebuilt_{type}_{cpu}_{host}_install.tar.gz)" |
| 44 | + ide_fformat = "[{t}](" + url + "/arc_gnu_{release}_ide_{host}_install.{ext})" |
| 45 | + le = "Little endian" |
| 46 | + be = "Big endian" |
| 47 | + |
| 48 | + args.description += """ |
| 49 | +| | Linux x86_64 | Windows x86_64 | macOS x86_64 | Linux ARC HS | |
| 50 | +| ------------------- | ------------ | -------------- | ------------ | ------------ | |
| 51 | +| Baremetal | {0} \ {1} | | {2} \ {3} | | |
| 52 | +| Linux/uClibc ARC700 | {4} \ {5} | | | | |
| 53 | +| Linux/uClibc ARC HS | {6} \ {7} | | {8} \ {9} | {10} | |
| 54 | +| IDE | {11} | {12} | | | |
| 55 | + """.format( |
| 56 | + fformat.format(t=le, release=args.release_id, type="baremetal", cpu="le", host="linux"), |
| 57 | + fformat.format(t=be, release=args.release_id, type="baremetal", cpu="be", host="linux"), |
| 58 | + fformat.format(t=le, release=args.release_id, type="baremetal", cpu="le", host="macos"), |
| 59 | + fformat.format(t=be, release=args.release_id, type="baremetal", cpu="be", host="macos"), |
| 60 | + fformat.format(t=le, release=args.release_id, type="uclibc", cpu="le_arc700", |
| 61 | + host="linux"), |
| 62 | + fformat.format(t=be, release=args.release_id, type="uclibc", cpu="be_arc700", |
| 63 | + host="linux"), |
| 64 | + fformat.format(t=le, release=args.release_id, type="uclibc", cpu="le_archs", |
| 65 | + host="linux"), |
| 66 | + fformat.format(t=be, release=args.release_id, type="uclibc", cpu="be_archs", |
| 67 | + host="linux"), |
| 68 | + fformat.format(t=le, release=args.release_id, type="uclibc", cpu="le_archs", |
| 69 | + host="macos"), |
| 70 | + fformat.format(t=be, release=args.release_id, type="uclibc", cpu="be_archs", |
| 71 | + host="macos"), |
| 72 | + fformat.format(t=le, release=args.release_id, type="uclibc", cpu="le_archs", |
| 73 | + host="native"), |
| 74 | + ide_fformat.format(t="Download", release=args.release_id, host="linux", ext="tar.gz"), |
| 75 | + ide_fformat.format(t="Download", release=args.release_id, host="win", ext="exe")) |
| 76 | + |
39 | 77 | if args.md5sum_file is not None: |
40 | 78 | with open(args.md5sum_file, "r") as f: |
41 | 79 | text = f.read() |
|
0 commit comments