feat: Implement configuration bundling for customer-specific builds and enhance build scripts

This commit is contained in:
claudi 2026-01-30 11:09:19 +01:00
parent 4e5deab7e9
commit a355c13c82
5 changed files with 750 additions and 22 deletions

View file

@ -11,7 +11,13 @@
# - create-dmg (optional, for custom DMG: brew install create-dmg)
#
# Usage:
# bash build_macos.sh [--sign] [--notarize]
# bash build_macos.sh [--sign] [--notarize] [--env-file PATH]
#
# Options:
# --sign Sign app (requires Apple developer certificate)
# --notarize Notarize app (requires Apple ID)
# --env-file PATH Use custom .env file (default: project root .env)
# Build fails if .env doesn't exist
set -e # Exit on error
@ -27,6 +33,9 @@ APP_NAME="WebDropBridge"
DMG_VOLUME_NAME="WebDrop Bridge"
VERSION="1.0.0"
# Default .env file
ENV_FILE="$PROJECT_ROOT/.env"
# Parse arguments
SIGN_APP=0
NOTARIZE_APP=0
@ -41,6 +50,10 @@ while [[ $# -gt 0 ]]; do
NOTARIZE_APP=1
shift
;;
--env-file)
ENV_FILE="$2"
shift 2
;;
*)
echo "Unknown option: $1"
exit 1
@ -48,6 +61,15 @@ while [[ $# -gt 0 ]]; do
esac
done
# Validate env file
if [ ! -f "$ENV_FILE" ]; then
echo "❌ Configuration file not found: $ENV_FILE"
echo "Please provide a valid .env file or use --env-file parameter"
exit 1
fi
echo "📋 Using configuration: $ENV_FILE"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
@ -154,6 +176,9 @@ build_executable() {
log_info "Building macOS executable with PyInstaller..."
echo ""
# Export env file for spec file to pick up
export WEBDROP_ENV_FILE="$ENV_FILE"
python3 -m PyInstaller \
--distpath="$DIST_DIR" \
--buildpath="$TEMP_BUILD" \