#!/usr/bin/env bash # Build the external handover package (Fase 5): one archive a receiver deploys into their own # Microsoft Foundry, without cloning this repository or having an account on our Forgejo. # # The archive is git's view of HEAD -- TRACKED FILES ONLY. That is deliberate and it is the whole # exposure control: STATE.md is gitignored, *.local.md is gitignored, .env is gitignored, so they # cannot enter the archive. A filter maintained here would be a second copy of that rule, and the # second copy is the one that drifts (kø-(p)). # # What the receiver gets is therefore HEAD itself -- never a hand-curated selection. That also # decided how the 14.08 directive ("runnable Python, no container wrapper") was carried out: the # Dockerfile and azure.yaml were removed from the TREE, not filtered out here. A filter would have # been a curation step deciding what a receiver sees, i.e. exactly the second copy this comment # exists to forbid. Absence is asserted in tests/test_handover_package_loadbearing.py. # # Usage: scripts/make-handover-package.sh [dest-dir] (default: dist/) # Gated by tests/test_handover_package_loadbearing.py. set -euo pipefail DEST="${1:-dist}" mkdir -p "$DEST" # Version from pyproject.toml -- the one place the build stamps it. Read, never hardcoded: a second # copy here would go stale at the next bump exactly like the README wheel filename did (Fase 3). VERSION=$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2) if [ -z "$VERSION" ]; then echo "make-handover-package: could not read version from pyproject.toml" >&2 exit 1 fi OUT="$DEST/portfolio-optimiser-foundry-$VERSION.zip" git archive --format=zip --output "$OUT" HEAD echo "$OUT"