From 18c34aa4a4c873ae029411f19771335428404a60 Mon Sep 17 00:00:00 2001 From: Pavel Kuznetsov Date: Thu, 26 Nov 2026 14:32:07 +0300 Subject: [PATCH] build: verify the tagged manifest before packaging ConstraintLens --- CLAUDE.md | 2 +- scripts/package_release.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 scripts/package_release.py diff --git a/CLAUDE.md b/CLAUDE.md index d2b1c00..e197909 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,7 +13,7 @@ Also watch the double-click-to-edit-sketch report — it was traced to the 500 m **v1.6.5 was released 2026-09-04**, so the v1.6.6 release body is the **v1.6.6 section of RELEASE_NOTES.md alone** — not a roll-up. The changelog is one section per version; take the section, nothing more. Remaining: 1. ~~PC-test v1.6.6~~ — **done 2026-10-01** by the maintainer, on the PR head before merging. 2. Tag v1.6.6 on the version-bump commit (`git tag v1.6.6 && git push origin v1.6.6` — from a PC; tag pushes fail from cloud sessions). -3. Publish the release: title `Constraint Lens v1.6.6`, body = the v1.6.6 section of RELEASE_NOTES.md, asset `ConstraintLens-v1.6.6.zip`. **Build the asset with `git archive --format=zip -9 -o ConstraintLens-v1.6.6.zip v1.6.6 ConstraintLens`** — from the tag, never the worktree, so the download cannot drift from what the tag says. That yields 23 entries, one top-level `ConstraintLens/` folder, no `__pycache__` or tests, ~60 KB. +3. Publish the release: title `Constraint Lens v1.6.6`, body = the v1.6.6 section of RELEASE_NOTES.md, asset `ConstraintLens-v1.6.6.zip`. **Build the asset with `python scripts/package_release.py v1.6.6`** — from the tag, never the worktree, so the download cannot drift from what the tag says. That yields 23 entries, one top-level `ConstraintLens/` folder, no `__pycache__` or tests, ~60 KB. 4. Reddit reply about the install path (`Utilities`, not `Tools`) — if not already done. 5. Reddit announcement of v1.6.5 — if not already done. 6. Close #11 once the original reporter confirms on real multi-monitor hardware. diff --git a/scripts/package_release.py b/scripts/package_release.py new file mode 100644 index 0000000..f0f6f81 --- /dev/null +++ b/scripts/package_release.py @@ -0,0 +1,35 @@ +"""Build a release ZIP from the tag whose version Fusion will display.""" +import argparse +import json +from pathlib import Path +import re +import subprocess + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("tag", help="existing release tag, e.g. v1.6.6") + args = parser.parse_args() + if not re.fullmatch(r"v[0-9]+(?:\.[0-9]+){2}", args.tag): + parser.error("expected a vX.Y.Z tag") + root = Path(__file__).resolve().parents[1] + ref = f"refs/tags/{args.tag}" + commit = subprocess.check_output( + ["git", "rev-parse", "--verify", ref + "^{commit}"], cwd=root, text=True + ).strip() + manifest = subprocess.check_output( + ["git", "show", f"{commit}:ConstraintLens/ConstraintLens.manifest"], cwd=root + ) + version = json.loads(manifest)["version"] + if args.tag != f"v{version}": + parser.error(f"{args.tag} contains manifest version {version}; check the tagged commit") + archive = Path(f"ConstraintLens-{args.tag}.zip") + subprocess.run( + ["git", "archive", "--format=zip", "-9", "-o", archive.resolve(), commit, "ConstraintLens"], + cwd=root, check=True, + ) + print(archive) + + +if __name__ == "__main__": + main()