# make_release.ps1 - pack tools/ into a self-contained production zip. # The zip holds the embedded Python runtime (python-embed/, bleak+pyserial # preinstalled) and NSpyocd, so the target PC needs NO installation. # Excludes the dev-only venv and caches; keeps out/ (the firmware images). # NOTE: the zip is staged in $TEMP first - writing it into out/ while # reading out/ would make Compress-Archive read its own half-written file. $tools = Split-Path -Parent $MyInvocation.MyCommand.Path $stamp = Get-Date -Format "yyyyMMdd_HHmm" $stage = Join-Path $env:TEMP "mothercup_tools_$stamp.zip" $final = Join-Path $tools "out\mothercup_tools_$stamp.zip" $items = Get-ChildItem $tools | Where-Object { $_.Name -notin @('.venv-ble', '__pycache__') } Compress-Archive -Path ($items | ForEach-Object { $_.FullName }) -DestinationPath $stage -Force -ErrorAction Stop Move-Item $stage $final -Force Write-Output "packed: $final"