Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
5.2 kB · 132 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133#!/usr/bin/env fish# Update Perforce and build SpiderLily Mac from the dev container# Follows same pattern as Windows remote-update-and-build.fish
set build_version (date +%Y.%m.%d-%H%M)set log_file "/tmp/build-mac-$build_version.log"
echo "========================================="echo "Update & Rebuild SpiderLily (Mac)"echo "========================================="echo ""echo "Version: $build_version"echo ""
# Load Mac credentialsset VAULT_DIR /workspaces/aesthetic-computer/aesthetic-computer-vault/false.workset MAC_CREDS $VAULT_DIR/mac-builder-credentials.env
if not test -f $MAC_CREDS echo "❌ Mac credentials not found: $MAC_CREDS" exit 1end
set MAC_HOST (grep '^MAC_HOST=' $MAC_CREDS | cut -d= -f2 | tr -d '"')set MAC_USERNAME (grep '^MAC_USERNAME=' $MAC_CREDS | cut -d= -f2 | tr -d '"')set MAC_PASSWORD (grep '^MAC_PASSWORD=' $MAC_CREDS | cut -d= -f2 | tr -d '"')
# Check if sshpass is installedif not command -v sshpass >/dev/null echo "❌ sshpass is not installed. Please rebuild the devcontainer or run:" echo " sudo dnf install -y sshpass" exit 1end
# Helper for SSH commandsfunction ssh_exec sshpass -p "$MAC_PASSWORD" ssh -o StrictHostKeyChecking=no "$MAC_USERNAME@$MAC_HOST" $argvend
echo "========================================="echo "Syncing build script to Mac..."echo "========================================="sshpass -p "$MAC_PASSWORD" scp -o StrictHostKeyChecking=no \ /workspaces/aesthetic-computer/false.work/build-run-spiderlily.sh \ "$MAC_USERNAME@$MAC_HOST:~/build-spiderlily.sh"ssh_exec "chmod +x ~/build-spiderlily.sh"echo ""
# Run build on Mac via SSH (streaming output to log file)echo "========================================="echo "Building on Mac..."echo "========================================="ssh_exec "~/build-spiderlily.sh $build_version 2>&1" | tee $log_file
# Verify build exists and is substantial (>100MB)set build_size (ssh_exec "du -sk ~/Builds/$build_version/Mac 2>/dev/null | cut -f1")
if test -z "$build_size" -o "$build_size" -lt 100000 echo "" echo "❌ Build verification failed!" echo " Expected Mac folder >100MB, got: $build_size KB" exit 1end
echo ""echo "✅ Build verified: "(math $build_size / 1024)" MB"
echo ""echo "========================================="echo "Copying build to assets..."echo "========================================="
# Create ZIP on Mac if it doesn't existset zip_name "spiderlily-mac-$build_version.zip"ssh_exec "cd ~/Builds/$build_version && zip -r -q ~/$zip_name Mac/"
# Copy ZIP to local assetssshpass -p "$MAC_PASSWORD" scp -o StrictHostKeyChecking=no \ "$MAC_USERNAME@$MAC_HOST:~/$zip_name" \ /workspaces/aesthetic-computer/system/public/assets/false.work/
# Copy log file to assetscp $log_file /workspaces/aesthetic-computer/system/public/assets/false.work/spiderlily-mac-$build_version.txt
echo ""echo "========================================="echo "Uploading to assets.aesthetic.computer..."echo "========================================="
# Direct S3 upload for build files (npm run assets:sync:up excludes large zips)set local_zip /workspaces/aesthetic-computer/system/public/assets/false.work/$zip_nameset local_log /workspaces/aesthetic-computer/system/public/assets/false.work/spiderlily-mac-$build_version.txtset s3_endpoint "https://sfo3.digitaloceanspaces.com"set s3_bucket "s3://assets-aesthetic-computer/false.work"
aws s3 cp $local_zip $s3_bucket/$zip_name --endpoint-url $s3_endpoint --acl public-readaws s3 cp $local_log $s3_bucket/spiderlily-mac-$build_version.txt --endpoint-url $s3_endpoint --acl public-read
echo ""echo "========================================="echo "Registering build in database..."echo "========================================="
# Ensure the file exists before calculating sizeif not test -f /workspaces/aesthetic-computer/system/public/assets/false.work/$zip_name echo "❌ Build ZIP not found at /workspaces/aesthetic-computer/system/public/assets/false.work/$zip_name" exit 1end
# Get file size in MB (rounded to whole number)set file_size (math -s0 (stat -c%s /workspaces/aesthetic-computer/system/public/assets/false.work/$zip_name) / 1048576)set download_url "https://assets.aesthetic.computer/false.work/$zip_name"set log_url "https://assets.aesthetic.computer/false.work/spiderlily-mac-$build_version.txt"set iso_timestamp (date -Iseconds)
# Extract start level from DefaultEngine.ini (get last part after dot)set full_map (ssh_exec "grep 'GameDefaultMap=' ~/Perforce/spiderlily_build_workspace_macmini/SL_main/Config/DefaultEngine.ini | cut -d= -f2")set start_level (echo $full_map | awk -F'.' '{print $NF}')
# Extract UE versionset ue_version "UE_5.6"
# Register build in MongoDB via Netlify functionsource /workspaces/aesthetic-computer/false.work/unreal-builder/scripts/shared/register-build.fishregister_build "mac" "$build_version" "$iso_timestamp" "$file_size" "$download_url" "$start_level" "$ue_version" "$log_url"
echo ""echo "✅ Build complete and deployed!"echo "📦 Build: $build_version"echo "🔗 Download: $download_url"echo "🌐 Page: https://builds.false.work"