Skip to content

Commit b78f640

Browse files
Release: Create a download table in release description
Signed-off-by: Anton Kolesov <[email protected]>
1 parent a4d2e44 commit b78f640

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

github/create-release.py

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
logging.basicConfig(level=logging.INFO)
2424

2525
parser = argparse.ArgumentParser()
26-
parser.add_argument("assets", nargs="+")
26+
parser.add_argument("assets", nargs="*")
2727
parser.add_argument("--owner", required=True)
2828
parser.add_argument("--project", required=True)
2929
parser.add_argument("--tag", required=True)
30+
parser.add_argument("--release-id", help="Tag name without prefix and suffix")
3031
parser.add_argument("--name", required=True)
3132
parser.add_argument("--description", default="")
3233
parser.add_argument("--md5sum-file", help="File with md5sums for uploaded assets")
@@ -36,6 +37,43 @@
3637

3738
args = parser.parse_args()
3839

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+
3977
if args.md5sum_file is not None:
4078
with open(args.md5sum_file, "r") as f:
4179
text = f.read()

release.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ endif
10371037
upload: $O/$(MD5SUM_FILE)
10381038
$(PYTHON) github/create-release.py --owner=foss-for-synopsys-dwc-arc-processors \
10391039
--project=toolchain --tag=$(RELEASE_TAG) --draft \
1040+
--release-id=$(RELEASE) \
10401041
--name="$(RELEASE_NAME)" \
10411042
--prerelease --oauth-token=$(shell cat ~/.github_oauth_token) \
10421043
--md5sum-file=$O/$(MD5SUM_FILE) \

0 commit comments

Comments
 (0)