diff options
Diffstat (limited to 'publish.py')
| -rwxr-xr-x | publish.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/publish.py b/publish.py new file mode 100755 index 0000000..e83b4d6 --- /dev/null +++ b/publish.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import subprocess +import sys +from pathlib import Path + + +ROOT = Path(__file__).resolve().parent + + +def run(*argv: str) -> None: + print(f"[publish] {' '.join(argv)}", flush=True) + subprocess.run(argv, cwd=ROOT, check=True) + + +def main() -> None: + run("./check.py", "install") + run("git", "push", "swarm", "main") + run("git", "push", "github", "main") + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + raise SystemExit(130) + except subprocess.CalledProcessError as error: + raise SystemExit(error.returncode) |