Package Anidev Skill and standalone API panel integration
This commit is contained in:
1 parent
8e4e8e6ef0
commit
61b05abe44
43 files changed
+1859
-57
No files matched your search
@@ -0,0 +1,26 @@
|
||||
"""Archive already-built, self-contained deliverables; no publishing or installation."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile, ZIP_DEFLATED
|
||||
|
||||
root = Path(__file__).resolve().parent.parent
|
||||
version = json.loads((root / "package.json").read_text(encoding="utf-8"))["version"]
|
||||
dist = root / "dist"
|
||||
for source, name, prefix in [
|
||||
(dist / "skills/anidev-design-system", f"anidev-skill-{version}.zip", "anidev-design-system"),
|
||||
(dist / "starter", f"anidev-panel-{version}.zip", "anidev-panel"),
|
||||
]:
|
||||
if not (source / ("SKILL.md" if "skill" in name else "index.html")).is_file():
|
||||
raise SystemExit("Run npm run build:package first")
|
||||
files = sorted(source.rglob("*"))
|
||||
target = dist / name
|
||||
with ZipFile(target, "w", ZIP_DEFLATED) as archive:
|
||||
for file in files:
|
||||
if file.is_symlink():
|
||||
raise SystemExit(f"Symlink in release input: {file}")
|
||||
if file.is_file():
|
||||
archive.write(file, (Path(prefix) / file.relative_to(source)).as_posix())
|
||||
with ZipFile(target) as archive:
|
||||
if archive.testzip() is not None:
|
||||
raise SystemExit(f"Invalid archive: {target}")
|
||||
print(f"{target.name}: {len(archive.namelist())} files, CRC valid")
|
||||
Reference in new issue
Block a user