From: Matthew Fernandez Date: Sat, 26 Feb 2022 21:30:41 +0000 (-0800) Subject: CI: skip package uploading and deployment steps on non-release revisions X-Git-Tag: 4.0.0~200^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ff71daaf77a9be1e0663f264a569772be520ae9;p=graphviz CI: skip package uploading and deployment steps on non-release revisions Traditionally CI has uploaded release artifacts and packaged a “release” for every single commit on the main branch. These inter-release packages were intended for testing and internal deployment. As far as we aware these are no longer used; all Graphviz developers build from source and do not rely on Gitlab’s generic package repository.¹ This change rearranges deployment steps to skip uploading artifacts and packaging if the current commit is not a proper release. This should slightly accelerate CI and reduce Graphviz storage requirements, which are currently at >800GB on Gitlab. Gitlab: closes #2139 ¹ https://gitlab.com/graphviz/graphviz/-/packages --- diff --git a/ci/deploy.py b/ci/deploy.py index 808270a47..fbd851e1e 100644 --- a/ci/deploy.py +++ b/ci/deploy.py @@ -153,6 +153,13 @@ def main(args: List[str]) -> int: # pylint: disable=missing-function-docstring package_version = options.version log.info(f"using generic package version {package_version}") + # we only create Gitlab releases for stable version numbers + if not options.force: + if re.match(r"\d+\.\d+\.\d+$", options.version) is None: + log.warning(f"skipping release creation because {options.version} is not " + "of the form \\d+.\\d+.\\d+") + return 0 + # list of assets we have uploaded assets: List[str] = [] @@ -226,13 +233,6 @@ def main(args: List[str]) -> int: # pylint: disable=missing-function-docstring "them being unviewable in web page lists") return -1 - # we only create Gitlab releases for stable version numbers - if not options.force: - if re.match(r"\d+\.\d+\.\d+$", options.version) is None: - log.warning(f"skipping release creation because {options.version} is not " - "of the form \\d+.\\d+.\\d+") - return 0 - # construct a command to create the release itself cmd = ["release-cli", "create", "--name", options.version, "--tag-name", options.version, "--description", "See the [CHANGELOG](https://gitlab.com/"