# HG changeset patch # User Georges Racinet <georges.racinet@cloudcrane.io> # Date 1737643298 -3600 # Thu Jan 23 15:41:38 2025 +0100 # Node ID 9b70fb4dd3ea836f9342791b95c27c2a2325f09d # Parent 7b5986eb9dd88f2813652c7dc8be1b8ca1b52e8f release-full: different microblogging messages for final and rc diff --git a/release-full b/release-full --- a/release-full +++ b/release-full @@ -2,6 +2,7 @@ import argparse import logging from pathlib import Path +import re import subprocess FILE_PATH = Path(__file__) @@ -9,7 +10,7 @@ logger = logging.getLogger(FILE_PATH.name.rsplit('.', 1)[0]) -TWITT_TEMPLATE = ( +TWITT_TEMPLATE_RC = ( "#heptapod {version} " "released, COMMENT_HERE " "Docker: https://hub.docker.com/r/heptapod/heptapod/" @@ -18,6 +19,21 @@ "HEPTAPOD_CHANGELOG.md #git #mercurial" ) +TWITT_TEMPLATE_FINAL = ( + "#heptapod {version} " + "released, COMMENT_HERE " + "Changelog: " + "https://foss.heptapod.net/heptapod/heptapod/-/blob/heptapod-{version}/" + "HEPTAPOD_CHANGELOG.md " + "Download instructions: " + "https://heptapod.net/pages/get-heptapod.html#get-heptapod " + "#git #mercurial" +) + + +def is_final_version(version): + return re.match(r'^\d+\.\d+\.\d+$', version) is not None + def validate_sha256(s): assert len(s) == 64 @@ -108,7 +124,11 @@ check_call(push_release, simulate=simulate) print("\nNow brag about it on social media, inserting additional comments " "into the following:\n") - print(TWITT_TEMPLATE.format(version=version)) + if is_final_version(version): + tmpl = TWITT_TEMPLATE_FINAL + else: + tmpl = TWITT_TEMPLATE_RC + print(tmpl.format(version=version)) if __name__ == '__main__':