Release Anidev Design System 1.0.0
This commit is contained in:
1 parent
2b45df2816
commit
e5a14f7ed0
16 files changed
+119
-72
No files matched your search
@@ -1,5 +1,7 @@
|
||||
"""Archive already-built, self-contained deliverables; no publishing or installation."""
|
||||
import json
|
||||
import hashlib
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile, ZIP_DEFLATED
|
||||
|
||||
@@ -7,10 +9,12 @@ 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 / "package", f"anidev-design-system-{version}.zip", "anidev-design-system"),
|
||||
(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():
|
||||
entry = "SKILL.md" if "skill" in name else ("index.html" if "panel" in name else "package.json")
|
||||
if not (source / entry).is_file():
|
||||
raise SystemExit("Run npm run build:package first")
|
||||
files = sorted(source.rglob("*"))
|
||||
target = dist / name
|
||||
@@ -24,3 +28,17 @@ for source, name, prefix in [
|
||||
if archive.testzip() is not None:
|
||||
raise SystemExit(f"Invalid archive: {target}")
|
||||
print(f"{target.name}: {len(archive.namelist())} files, CRC valid")
|
||||
|
||||
icons = root / "icons/anidev-dock-icons.zip"
|
||||
with ZipFile(icons) as archive:
|
||||
if archive.testzip() is not None:
|
||||
raise SystemExit("Invalid icon archive")
|
||||
shutil.copyfile(icons, dist / f"anidev-icons-{version}.zip")
|
||||
names = [f"anidev-{part}-{version}.zip" for part in ("design-system", "panel", "skill", "icons")]
|
||||
artifacts = []
|
||||
for name in names:
|
||||
file = dist / name
|
||||
artifacts.append({"name": name, "bytes": file.stat().st_size, "sha256": hashlib.sha256(file.read_bytes()).hexdigest()})
|
||||
(dist / "SHA256SUMS.txt").write_text("".join(f"{item['sha256']} {item['name']}\n" for item in artifacts), encoding="utf-8")
|
||||
(dist / "release-manifest.json").write_text(json.dumps({"version": version, "channel": "stable", "artifacts": artifacts}, indent=2) + "\n", encoding="utf-8")
|
||||
print(f"Prepared {len(artifacts)} release archives, SHA256SUMS.txt and release-manifest.json")
|
||||
Reference in new issue
Block a user