-
-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathbuild_release.py
More file actions
79 lines (66 loc) · 1.65 KB
/
build_release.py
File metadata and controls
79 lines (66 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python3
"""Build a clean release zip for agentchattr.
Packages only user-facing files — no .git, no dev files, no logs, no caches.
Output: agentchattr-{version}.zip in the repo root.
"""
import shutil
import tempfile
from pathlib import Path
ROOT = Path(__file__).parent
VERSION = (ROOT / "VERSION").read_text().strip()
OUT_NAME = f"agentchattr-{VERSION}"
# Files and dirs to include (relative to repo root)
INCLUDE_FILES = [
"app.py",
"agents.py",
"config_loader.py",
"jobs.py",
"mcp_bridge.py",
"mcp_proxy.py",
"registry.py",
"router.py",
"rules.py",
"run.py",
"session_engine.py",
"session_store.py",
"store.py",
"schedules.py",
"summaries.py",
"wrapper.py",
"wrapper_api.py",
"wrapper_unix.py",
"wrapper_windows.py",
"open_chat.html",
"config.toml",
"config.local.toml.example",
"requirements.txt",
"README.md",
"LICENSE",
"VERSION",
"screenshot.png",
"gang.gif",
]
INCLUDE_DIRS = [
"static",
"windows",
"macos-linux",
"session_templates",
]
def build():
with tempfile.TemporaryDirectory() as tmp:
dest = Path(tmp) / OUT_NAME
dest.mkdir()
for f in INCLUDE_FILES:
src = ROOT / f
if src.exists():
shutil.copy2(src, dest / f)
for d in INCLUDE_DIRS:
src = ROOT / d
if src.exists():
shutil.copytree(src, dest / d)
out_path = ROOT / OUT_NAME
shutil.make_archive(str(out_path), "zip", tmp, OUT_NAME)
print(f"Built {out_path}.zip")
return f"{out_path}.zip"
if __name__ == "__main__":
build()