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

Commit

Permalink
Generate announcement links in release script (#12242)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Mar 17, 2022
1 parent 9e06e22 commit 12d1f82
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/12242.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generate announcement links in the release script.
41 changes: 40 additions & 1 deletion scripts-dev/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ def cli():
./scripts-dev/release.py tag
# ... wait for asssets to build ...
# ... wait for assets to build ...
./scripts-dev/release.py publish
./scripts-dev/release.py upload
# Optional: generate some nice links for the announcement
./scripts-dev/release.py upload
If the env var GH_TOKEN (or GITHUB_TOKEN) is set, or passed into the
`tag`/`publish` command, then a new draft release will be created/published.
"""
Expand Down Expand Up @@ -415,6 +419,41 @@ def upload():
)


@cli.command()
def announce():
"""Generate markdown to announce the release."""

current_version, _, _ = parse_version_from_module()
tag_name = f"v{current_version}"

click.echo(
f"""
Hi everyone. Synapse {current_version} has just been released.
[notes](https://github.com/matrix-org/synapse/releases/tag/{tag_name}) |\
[docker](https://hub.docker.com/r/matrixdotorg/synapse/tags?name={tag_name}) | \
[debs](https://packages.matrix.org/debian/) | \
[pypi](https://pypi.org/project/matrix-synapse/{current_version}/)"""
)

if "rc" in tag_name:
click.echo(
"""
Announce the RC in
- #homeowners:matrix.org (Synapse Announcements)
- #synapse-dev:matrix.org"""
)
else:
click.echo(
"""
Announce the release in
- #homeowners:matrix.org (Synapse Announcements), bumping the version in the topic
- #synapse:matrix.org (Synapse Admins), bumping the version in the topic
- #synapse-dev:matrix.org
- #synapse-package-maintainers:matrix.org"""
)


def parse_version_from_module() -> Tuple[
version.Version, redbaron.RedBaron, redbaron.Node
]:
Expand Down

0 comments on commit 12d1f82

Please sign in to comment.