]> granicus.if.org Git - graphviz/commitdiff
CI: skip package uploading and deployment steps on non-release revisions
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Feb 2022 21:30:41 +0000 (13:30 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 5 Mar 2022 04:32:42 +0000 (20:32 -0800)
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

ci/deploy.py

index 808270a472eae895a0fe5651ad477182d74a5aa9..fbd851e1eb81bb6eb59a7cb2a22e39bf15ac22c2 100644 (file)
@@ -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/"