From: Matthew Fernandez Date: Tue, 23 Nov 2021 02:25:51 +0000 (-0800) Subject: deploy.py: outline functionality for deriving the 'format' field of JSON output X-Git-Tag: 2.50.0~15^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32b91edef64d1c726c88c7a7d6e68239399cc358;p=graphviz deploy.py: outline functionality for deriving the 'format' field of JSON output This will be used in a future commit to add Windows entries to the JSON data. --- diff --git a/ci/deploy.py b/ci/deploy.py index 8e0d4f500..be6473cd8 100644 --- a/ci/deploy.py +++ b/ci/deploy.py @@ -83,6 +83,14 @@ def is_windows_artifact(path: Path) -> bool: """is this a deployment artifact for Windows?""" return re.search(r"\bwindows\b", str(path)) is not None +def get_format(path: Path) -> str: + """a human readable description of the format of this file""" + if path.suffix[1:].lower() == "exe": + return "EXE installer" + if path.suffix[1:].lower() == "zip": + return "ZIP installer" + return path.suffix[1:].lower() + def main(args: List[str]) -> int: # pylint: disable=missing-function-docstring # setup logging to print to stderr @@ -167,7 +175,7 @@ def main(args: List[str]) -> int: # pylint: disable=missing-function-docstring url = upload(package_version, tarball) assets.append(url) webentry = { - "format": tarball.suffix[1:], + "format": get_format(tarball), "url": url } for check in checksum(tarball):