Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
5.4 kB ยท 139 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140#!/usr/bin/fish
# Build Aesthetic Computer Electron app for all platforms from devcontainer# Uses Docker for cross-platform builds and vault credentials for signing
set script_dir (dirname (status -f))set vault_dir /workspaces/aesthetic-computer/aesthetic-computer-vault/ac-electron
echo "๐จ Aesthetic Computer Multi-Platform Electron Builder"echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo ""
# Check if vault credentials existif not test -d $vault_dir echo "โ Vault directory not found: $vault_dir" echo " Create it and add signing certificates (see vault README)" exit 1end
# Source vault environment if it existsif test -f $vault_dir/.env echo "๐ Loading credentials from vault..." set -a source $vault_dir/.env set +aelse echo "โ ๏ธ No .env found in vault - builds will be unsigned" echo " Copy .env.template to .env and fill in credentials for signed builds"end
echo ""echo "๐ฆ Building packages:"echo " โข Linux (AppImage, deb, rpm) - native build"echo " โข Windows (exe) - via Docker wine container"echo " โข macOS (dmg) - requires macOS host or CI/CD"echo ""
# Change to ac-electron directorycd $script_dir
# Clean previous buildsecho "๐งน Cleaning previous builds..."rm -rf dist/mkdir -p dist/
echo ""echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo "๐ง Building Linux packages..."echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
# Linux - native build (we're on Linux in devcontainer)npm run build:linux
if test $status -eq 0 echo "โ
Linux builds complete" ls -lh dist/*.AppImage dist/*.deb dist/*.rpm 2>/dev/null || trueelse echo "โ Linux build failed"end
echo ""echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo "๐ช Building Windows package..."echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
# Windows - use electron-builder's wine Docker container# This allows building Windows .exe from Linuxif command -v docker >/dev/null 2>&1 echo "Using Docker wine container for Windows build..."
# Copy vault credentials into build directory for Docker access if test -f $vault_dir/.env cp $vault_dir/.env .env.build if test -f $vault_dir/windows-code-signing.pfx cp $vault_dir/windows-code-signing.pfx ./ end end
docker run --rm \ -v (pwd):/project \ -v ~/.cache/electron:/root/.cache/electron \ -v ~/.cache/electron-builder:/root/.cache/electron-builder \ electronuserland/builder:wine \ bash -c "cd /project && npm run build:win"
# Cleanup temp files rm -f .env.build windows-code-signing.pfx
if test $status -eq 0 echo "โ
Windows build complete" ls -lh dist/*.exe 2>/dev/null || true else echo "โ Windows build failed" endelse echo "โ ๏ธ Docker not available - skipping Windows build" echo " Install Docker to enable cross-platform Windows builds"end
echo ""echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo "๐ macOS build..."echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
# macOS - can't build from Linux without a Macecho "โ ๏ธ macOS builds require a macOS host or GitHub Actions"echo " Options:"echo " 1. Run this script on a Mac"echo " 2. Use GitHub Actions (push tag to trigger workflow)"echo " 3. Use a macOS VM or cloud build service"
echo ""echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo "๐ Build Summary"echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo ""echo "Built artifacts:"ls -lh dist/ | grep -v "^d" | grep -v "^total" || echo " No artifacts found"echo ""
# Calculate total sizeset total_size (du -sh dist/ | cut -f1)echo "Total size: $total_size"echo ""
# Show next stepsecho "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo "Next Steps"echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"echo ""echo "To publish to GitHub releases:"echo " gh release create v(cat package.json | jq -r .version) \\"echo " --title 'v(cat package.json | jq -r .version)' \\"echo " --notes 'Release notes here' \\"echo " dist/*.AppImage dist/*.deb dist/*.rpm dist/*.exe"echo ""echo "Or for macOS-only release from a Mac:"echo " npm run publish:mac"echo ""