|
67 | 67 | "tests", |
68 | 68 | "docs", |
69 | 69 | "kicad_files", # sample boards: large and unnecessary at runtime |
| 70 | + "artifacts", # CI downloads release binaries here before packaging |
70 | 71 | } |
71 | 72 |
|
72 | 73 | # CLAUDE.md and .claude/ (the routing skills) ship intentionally so they can be |
@@ -98,13 +99,23 @@ def read_version(): |
98 | 99 | return (SCRIPT_DIR / "VERSION").read_text().strip() |
99 | 100 |
|
100 | 101 |
|
101 | | -def stage_plugins(stage_root: Path): |
| 102 | +def stage_plugins(stage_root: Path, binary_dir: Path | None = None): |
102 | 103 | """Copy the repo working tree (minus ROOT_EXCLUDE / IGNORE_PATTERNS) into |
103 | | - <stage_root>/plugins/.""" |
| 104 | + <stage_root>/plugins/. |
| 105 | +
|
| 106 | + binary_dir, when it lives inside the repo (CI downloads release binaries to |
| 107 | + ./artifacts before packaging), is skipped so it isn't swept into the plugin. |
| 108 | + """ |
104 | 109 | plugins_dir = stage_root / "plugins" |
105 | 110 | plugins_dir.mkdir(parents=True, exist_ok=True) |
106 | 111 |
|
107 | 112 | ignored_names = set(ROOT_EXCLUDE) |
| 113 | + if binary_dir is not None: |
| 114 | + try: |
| 115 | + ignored_names.add(binary_dir.resolve().relative_to(SCRIPT_DIR).parts[0]) |
| 116 | + except (ValueError, IndexError): |
| 117 | + pass # binary_dir is outside the repo; nothing to skip |
| 118 | + |
108 | 119 | for entry in sorted(SCRIPT_DIR.iterdir()): |
109 | 120 | if entry.name in ignored_names: |
110 | 121 | continue |
@@ -228,7 +239,7 @@ def main(): |
228 | 239 | print(f"Building PCM package: {zip_name}") |
229 | 240 | with tempfile.TemporaryDirectory(prefix="kicadrt-pcm-") as tmp: |
230 | 241 | stage_root = Path(tmp) |
231 | | - plugins_dir = stage_plugins(stage_root) |
| 242 | + plugins_dir = stage_plugins(stage_root, binary_dir) |
232 | 243 | install_binaries(plugins_dir, version, binary_dir) |
233 | 244 | write_top_level(stage_root, version) |
234 | 245 | install_size = make_zip(stage_root, out_zip) |
|
0 commit comments