From: Matthew Fernandez Date: Wed, 3 Mar 2021 02:12:23 +0000 (-0800) Subject: generate checksums for macOS and Windows packages during deployment X-Git-Tag: 2.47.0~2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=239f6301789b603202d500f7ae58e800354c1524;p=graphviz generate checksums for macOS and Windows packages during deployment This is in addition to the previously generated portable source checksum. For now, it is assumed we don't need checksums for the fined grained Linux packages. Closes #1955. --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 36442c97a..6585cf2a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - RxSpencer is no longer a dependency on Windows - gvmap.sh is compatible with POSIX shells in addition to ksh - sed is no longer a build dependency on Windows +- SHA256 checksum generation? #1955 ### Fixed - Fix gvpr -? to actually print usage and exit non-zero diff --git a/ci/deploy.py b/ci/deploy.py index 6c23ce62e..16e2ec135 100644 --- a/ci/deploy.py +++ b/ci/deploy.py @@ -83,6 +83,18 @@ def checksum(path: str) -> Generator[str, None, None]: f.write(f'{hashlib.sha256(data.read()).hexdigest()} {path}\n') yield check +def is_macos_artifact(path: str) -> bool: + ''' + is this a deployment artifact for macOS? + ''' + return re.search(r'\bDarwin\b', path) is not None + +def is_windows_artifact(path: str) -> bool: + ''' + is this a deployment artifact for Windows? + ''' + return re.search(r'\bWindows\b', path) is not None + def main(args: List[str]) -> int: # setup logging to print to stderr @@ -171,6 +183,12 @@ def main(args: List[str]) -> int: assets.append(upload(package_version, path, path[len('Packages/'):])) + # if this is a standalone Windows or macOS package, also provide + # checksum(s) + if is_macos_artifact(path) or is_windows_artifact(path): + for c in checksum(path): + assets.append(upload(package_version, c, c[len('Packages/'):])) + # we only create Gitlab releases for stable version numbers if not options.force: if re.match(r'\d+\.\d+\.\d+$', options.version) is None: