Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 12d1f82

Browse files
author
David Robertson
authored
Generate announcement links in release script (#12242)
1 parent 9e06e22 commit 12d1f82

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

changelog.d/12242.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Generate announcement links in the release script.

scripts-dev/release.py

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@ def cli():
6666
6767
./scripts-dev/release.py tag
6868
69-
# ... wait for asssets to build ...
69+
# ... wait for assets to build ...
7070
7171
./scripts-dev/release.py publish
7272
./scripts-dev/release.py upload
7373
74+
# Optional: generate some nice links for the announcement
75+
76+
./scripts-dev/release.py upload
77+
7478
If the env var GH_TOKEN (or GITHUB_TOKEN) is set, or passed into the
7579
`tag`/`publish` command, then a new draft release will be created/published.
7680
"""
@@ -415,6 +419,41 @@ def upload():
415419
)
416420

417421

422+
@cli.command()
423+
def announce():
424+
"""Generate markdown to announce the release."""
425+
426+
current_version, _, _ = parse_version_from_module()
427+
tag_name = f"v{current_version}"
428+
429+
click.echo(
430+
f"""
431+
Hi everyone. Synapse {current_version} has just been released.
432+
433+
[notes](https://github.com/matrix-org/synapse/releases/tag/{tag_name}) |\
434+
[docker](https://hub.docker.com/r/matrixdotorg/synapse/tags?name={tag_name}) | \
435+
[debs](https://packages.matrix.org/debian/) | \
436+
[pypi](https://pypi.org/project/matrix-synapse/{current_version}/)"""
437+
)
438+
439+
if "rc" in tag_name:
440+
click.echo(
441+
"""
442+
Announce the RC in
443+
- #homeowners:matrix.org (Synapse Announcements)
444+
- #synapse-dev:matrix.org"""
445+
)
446+
else:
447+
click.echo(
448+
"""
449+
Announce the release in
450+
- #homeowners:matrix.org (Synapse Announcements), bumping the version in the topic
451+
- #synapse:matrix.org (Synapse Admins), bumping the version in the topic
452+
- #synapse-dev:matrix.org
453+
- #synapse-package-maintainers:matrix.org"""
454+
)
455+
456+
418457
def parse_version_from_module() -> Tuple[
419458
version.Version, redbaron.RedBaron, redbaron.Node
420459
]:

0 commit comments

Comments
 (0)