M7: corpus manifest loader/validation, chrF/BLEU/token/numeric metrics, raw-output and report.md/report.json writer, and sprachmittler-cli languages/detect/eval. A synthetic 4-segment run with the 7B validated the harness; the private-corpus and 1.8B evaluation and the default-model ADR remain open. M8: privacy-check root fixture + seeded self-test wired into make verify; English/German localisation for the app shell; end-user USER_GUIDE; release.sh (unsigned archive, Developer ID sign, notarise/staple, DMG, --dry-run); idle CPU/memory and warm 7B measurements in PERFORMANCE. Docs: PROGRESS M7–M8, MODEL_EVALUATION results log/gate status, PERFORMANCE measurements, TESTING evaluation cases, ADR-008 status. Compatibility/VoiceOver/notarisation gates remain manual. Verified: make verify green (format, strict lint, privacy self-test, Debug+Release signatures, 227 package tests); CLI languages/detect/eval run; release dry-run.
68 lines
2.2 KiB
Bash
Executable File
68 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build, sign, notarise, staple and package Sprachmittler. Use --dry-run first.
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
DRY_RUN=0
|
|
SKIP_NOTARIZE=0
|
|
VERSION="${MARKETING_VERSION:-0.1.0}"
|
|
BUILD="$ROOT/build/release"
|
|
ARCHIVE="$BUILD/Sprachmittler.xcarchive"
|
|
APP="$ARCHIVE/Products/Applications/Sprachmittler.app"
|
|
IDENTITY="${DEVELOPER_ID_APPLICATION:-}"
|
|
PROFILE="${SPRACHMITTLER_NOTARY_PROFILE:-sprachmittler-notary}"
|
|
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--dry-run) DRY_RUN=1 ;;
|
|
--skip-notarize) SKIP_NOTARIZE=1 ;;
|
|
--version=*) VERSION="${arg#*=}" ;;
|
|
-h|--help)
|
|
echo "usage: scripts/release.sh [--dry-run] [--skip-notarize] [--version=X.Y.Z]"
|
|
echo "env: DEVELOPER_ID_APPLICATION, SPRACHMITTLER_NOTARY_PROFILE"
|
|
exit 0
|
|
;;
|
|
*) echo "unknown argument: $arg" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
run() {
|
|
if [[ "$DRY_RUN" -eq 1 ]]; then
|
|
printf '+ %s\n' "$*"
|
|
else
|
|
"$@"
|
|
fi
|
|
}
|
|
|
|
if [[ "$DRY_RUN" -eq 0 && -z "$IDENTITY" ]]; then
|
|
echo "DEVELOPER_ID_APPLICATION is required for a real release (Developer ID Application identity)." >&2
|
|
exit 2
|
|
fi
|
|
for tool in xcodegen xcodebuild codesign ditto xcrun hdiutil; do
|
|
command -v "$tool" >/dev/null || { echo "missing tool: $tool" >&2; exit 2; }
|
|
done
|
|
|
|
run mkdir -p "$BUILD"
|
|
run xcodegen generate --spec project.yml
|
|
run xcodebuild -project Sprachmittler.xcodeproj -scheme Sprachmittler -configuration Release \
|
|
-archivePath "$ARCHIVE" -destination 'platform=macOS,arch=arm64' \
|
|
CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO archive
|
|
run codesign --force --deep --options runtime \
|
|
--entitlements App/Sprachmittler.entitlements --sign "$IDENTITY" "$APP"
|
|
run codesign --verify --deep --strict --verbose=2 "$APP"
|
|
|
|
if [[ "$SKIP_NOTARIZE" -eq 0 ]]; then
|
|
run ditto -c -k --keepParent "$APP" "$BUILD/Sprachmittler.zip"
|
|
run xcrun notarytool submit "$BUILD/Sprachmittler.zip" --keychain-profile "$PROFILE" --wait
|
|
run xcrun stapler staple "$APP"
|
|
run xcrun stapler validate "$APP"
|
|
run spctl --assess --type execute --verbose=2 "$APP"
|
|
else
|
|
echo "warning: notarisation skipped (--skip-notarize)" >&2
|
|
fi
|
|
|
|
run hdiutil create -volname "Sprachmittler $VERSION" -srcfolder "$APP" -ov -format UDZO \
|
|
"$BUILD/Sprachmittler-$VERSION.dmg"
|
|
echo "Release artifacts: $BUILD"
|