feat: harden CAD showcase skill and delivery pipeline
This commit is contained in:
@@ -18,6 +18,8 @@ import subprocess
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import showcase_schema
|
||||
|
||||
|
||||
VARIANTS = [
|
||||
{
|
||||
@@ -160,10 +162,12 @@ def write_manifest(entries: list[dict[str, Any]], out_dir: Path, name: str) -> P
|
||||
}
|
||||
)
|
||||
manifest = {
|
||||
"manifest_version": showcase_schema.MANIFEST_VERSION,
|
||||
"name": name,
|
||||
"default_key": "standard",
|
||||
"variants": variants,
|
||||
}
|
||||
showcase_schema.validate_manifest(manifest)
|
||||
manifest_path = out_dir / "variants_manifest.json"
|
||||
manifest_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||
return manifest_path
|
||||
@@ -174,7 +178,12 @@ def main() -> int:
|
||||
spec_path = Path(args.spec)
|
||||
out_dir = Path(args.out_dir)
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
spec = json.loads(spec_path.read_text(encoding="utf-8"))
|
||||
spec = showcase_schema.normalize_spec(json.loads(spec_path.read_text(encoding="utf-8")))
|
||||
try:
|
||||
showcase_schema.validate_spec(spec)
|
||||
except showcase_schema.ValidationFailure as exc:
|
||||
print(str(exc), file=sys.stderr)
|
||||
return 3
|
||||
entries = write_variant_specs(spec, out_dir)
|
||||
if args.build:
|
||||
run_blender(entries, out_dir, args.blender, Path(args.build_script))
|
||||
|
||||
Reference in New Issue
Block a user