Support releasing on macOS. (#16266)
This commit is contained in:
parent
fd50a9b47c
commit
7e98d382f9
|
@ -0,0 +1 @@
|
|||
Update the release script to work on macOS.
|
|
@ -244,6 +244,12 @@ def _prepare() -> None:
|
|||
else:
|
||||
debian_version = new_version
|
||||
|
||||
if sys.platform == "darwin":
|
||||
run_until_successful(
|
||||
f"docker run --rm -v .:/synapse ubuntu:latest /synapse/scripts-dev/docker_update_debian_changelog.sh {new_version}",
|
||||
shell=True,
|
||||
)
|
||||
else:
|
||||
run_until_successful(
|
||||
f'dch -M -v {debian_version} "New Synapse release {new_version}."',
|
||||
shell=True,
|
||||
|
@ -566,14 +572,22 @@ def _notify(message: str) -> None:
|
|||
# for this.
|
||||
click.echo(f"\a{message}")
|
||||
|
||||
app_name = "Synapse Release Script"
|
||||
|
||||
# Try and run notify-send, but don't raise an Exception if this fails
|
||||
# (This is best-effort)
|
||||
# TODO Support other platforms?
|
||||
if sys.platform == "darwin":
|
||||
# See https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW224
|
||||
subprocess.run(
|
||||
f"""osascript -e 'display notification "{message}" with title "{app_name}"'""",
|
||||
shell=True,
|
||||
)
|
||||
else:
|
||||
subprocess.run(
|
||||
[
|
||||
"notify-send",
|
||||
"--app-name",
|
||||
"Synapse Release Script",
|
||||
app_name,
|
||||
"--expire-time",
|
||||
"3600000",
|
||||
message,
|
||||
|
|
Loading…
Reference in New Issue