From: Matthew Fernandez Date: Sat, 30 Jan 2021 21:05:11 +0000 (-0800) Subject: use release version for generic package version when possible X-Git-Tag: 2.46.1~5^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1689e75690473faca5f8b4b4670d3e71465f9aba;p=graphviz use release version for generic package version when possible This addresses my comment from the 2.46.0 retrospective: I realized after the fact that, though the generic package versions have a restricted format, our release versions fit that format. I.e. we could have the generated 0.0.287364… versions for commit snapshots, but for packages that contain a release we could use a version that is the same as the release version itself, e.g. 2.46.0. Now generic packages that correspond to a stable release will get the same generic package version as the release version itself. This should avoid some user confusion in future. --- diff --git a/ci/deploy.py b/ci/deploy.py index 04796f5fd..4135c6450 100644 --- a/ci/deploy.py +++ b/ci/deploy.py @@ -114,9 +114,14 @@ def main(args: [str]) -> int: # the generic package version has to be \d+.\d+.\d+ but it does not need to # correspond to the release version (which may not conform to this pattern if - # this is a dev release), so generate a compliant generic package version - package_version = f'0.0.{int(os.environ["CI_COMMIT_SHA"], 16)}' - log.info(f'using generated generic package version {package_version}') + # this is a dev release) + if re.match(r'\d+\.\d+\.\d+$', options.version) is None: + # generate a compliant version + package_version = f'0.0.{int(os.environ["CI_COMMIT_SHA"], 16)}' + else: + # we can use a version corresponding to the release version + package_version = options.version + log.info(f'using generic package version {package_version}') # list of assets we have uploaded assets: [str] = []