From 9a9a00380f3bd8c9751e75b9ccaff204cd4fbb76 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 2 Feb 2026 19:53:06 +0000 Subject: [PATCH] Add a release script to simplify building both. --- scripts/release.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/release.py diff --git a/scripts/release.py b/scripts/release.py new file mode 100755 index 0000000..ecbbbb5 --- /dev/null +++ b/scripts/release.py @@ -0,0 +1,35 @@ +#!/usr/bin/env -S uv run +"""Build and release both fastapi-vue and fastapi-vue-setup packages.""" + +import shutil +import subprocess +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +DIST = ROOT / "dist" +FASTAPI_VUE = ROOT / "fastapi-vue" + + +def main(): + # Clear the dist directory + if DIST.exists(): + shutil.rmtree(DIST) + DIST.mkdir() + + # Build fastapi-vue (subdirectory) to root dist + subprocess.run( + ["uv", "build", "--out-dir", str(DIST)], + cwd=FASTAPI_VUE, + check=True, + ) + + # Build fastapi-vue-setup (root) + subprocess.run( + ["uv", "build", "--out-dir", str(DIST)], + cwd=ROOT, + check=True, + ) + + +if __name__ == "__main__": + main()