feat: add release build scripts and manifest (A-2, A-3)

- scripts/build_release.sh: Build 3 binaries + generate manifest
- scripts/sign_binaries.sh: Ad-hoc sign binaries for macOS
- RELEASE_MANIFEST.txt: Record binary sizes, MD5, SHA256

Solves:
- A-2: Release build now includes momentry, rust_register, rust_unregister
- A-3: Binaries are signed to avoid SIGKILL on release machines

Verified: M4ProMini deployment (2026-10-04)
This commit is contained in:
Accusys
2026-10-04 13:42:17 +08:00
parent f79292f867
commit 3d363e6266
3 changed files with 84 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
# Momentry Release Manifest
# Generated: 2026-10-04 13:42:06
| Binary | Size (bytes) | MD5 | SHA256 |
|--------|--------------|-----|--------|
| momentry | 45997344 | `579ad496a1c9435f5cdba84d004d9307` | `ea1a8896cd6f77397588efe1a91160e440c4ef7c589f7abb62ed71f019ebabfe` |
| rust_register | 4062768 | `e2bbffe4e96634a8165d91e5684a08a3` | `cf903537e3506252ede71168c3956f96493dd0a05a1400290212fcf03f1181c7` |
| rust_unregister | 9424720 | `764e1f53fe5dfae1e60d1df4eee1644f` | `74251d239e81e694f29ed38077cf9a7855962cbd4640288818d340a2774f76cf` |
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
# Build release binaries and generate manifest
# Usage: ./scripts/build_release.sh
set -e
echo "=== Building release binaries ==="
cargo build --release --bin momentry --bin rust_register --bin rust_unregister
echo ""
echo "=== Generating manifest ==="
cd target/release
MANIFEST_FILE="../../RELEASE_MANIFEST.txt"
DATE=$(date +%Y-%m-%d)
TIME=$(date +%H:%M:%S)
echo "# Momentry Release Manifest" > "$MANIFEST_FILE"
echo "# Generated: $DATE $TIME" >> "$MANIFEST_FILE"
echo "" >> "$MANIFEST_FILE"
echo "| Binary | Size (bytes) | MD5 | SHA256 |" >> "$MANIFEST_FILE"
echo "|--------|--------------|-----|--------|" >> "$MANIFEST_FILE"
for B in momentry rust_register rust_unregister; do
if [ -f "$B" ]; then
SIZE=$(stat -f%z "$B")
MD5=$(md5 -q "$B")
SHA256=$(shasum -a 256 "$B" | cut -d' ' -f1)
echo "| $B | $SIZE | \`$MD5\` | \`$SHA256\` |" >> "$MANIFEST_FILE"
echo "✓ $B: $SIZE bytes"
else
echo "✗ Missing: $B"
exit 1
fi
done
echo ""
echo "=== Release build complete ==="
echo "Manifest: RELEASE_MANIFEST.txt"
cat "$MANIFEST_FILE"
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
# Sign release binaries with ad-hoc signature
# Usage: ./scripts/sign_binaries.sh
#
# Why: macOS kills unsigned binaries with SIGKILL (exit code 137)
# when copied from another machine.
#
# This script signs all binaries with ad-hoc signature ("-")
# which is sufficient for local execution.
set -e
cd target/release
echo "=== Signing release binaries ==="
for B in momentry rust_register rust_unregister; do
if [ -f "$B" ]; then
echo "Signing $B..."
codesign --force --sign - "$B"
# Verify signature
if codesign -dv "$B" 2>&1 | grep -q "Signature"; then
echo "✓ $B signed successfully"
else
echo "✗ Failed to sign $B"
exit 1
fi
else
echo "✗ Missing: $B"
exit 1
fi
done
echo ""
echo "=== All binaries signed ==="