name: Build Eden Emulator on: push: branches: - dev workflow_dispatch: jobs: build-linux: name: Build Linux runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y \ autoconf cmake g++ gcc git glslang-tools \ libglu1-mesa-dev libhidapi-dev libpulse-dev \ libtool libudev-dev libxcb-icccm4 libxcb-image0 \ libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 \ libxcb-xkb1 libxext-dev libxkbcommon-x11-0 \ mesa-common-dev nasm ninja-build qt6-base-private-dev \ libmbedtls-dev catch2 libfmt-dev liblz4-dev \ nlohmann-json3-dev libzstd-dev libssl-dev \ libavfilter-dev libavcodec-dev libswscale-dev \ pkg-config zlib1g-dev libva-dev libvdpau-dev \ qt6-tools-dev libvulkan-dev spirv-tools spirv-headers \ libusb-1.0-0-dev libxbyak-dev libboost-dev \ libboost-fiber-dev libboost-context-dev libsdl2-dev \ libopus-dev vulkan-utility-libraries-dev - name: Configure CMake run: | cmake -S . -B build -G "Ninja" \ -DCMAKE_BUILD_TYPE=Release \ -DYUZU_TESTS=OFF \ -DENABLE_QT_TRANSLATION=OFF - name: Build Eden run: | cmake --build build --parallel $(nproc) - name: Package Artifacts run: | mkdir -p artifacts cp build/bin/eden artifacts/ || echo "eden not found" cp build/bin/eden-cmd artifacts/ || echo "eden-cmd not found" if [ -f artifacts/eden ]; then chmod +x artifacts/eden fi if [ -f artifacts/eden-cmd ]; then chmod +x artifacts/eden-cmd fi # Create version info echo "Eden Emulator - Linux Build" > artifacts/VERSION.txt echo "Build Date: $(date)" >> artifacts/VERSION.txt echo "Commit: $(git rev-parse --short HEAD)" >> artifacts/VERSION.txt - name: Create tarball run: | cd artifacts tar -czf ../eden-linux-x64.tar.gz . cd .. - name: Upload Linux Build uses: actions/upload-artifact@v4 with: name: eden-linux-x64 path: eden-linux-x64.tar.gz retention-days: 30 build-windows-wine: name: Build Windows (Wine + MSYS2) runs-on: ubuntu-latest timeout-minutes: 180 steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - name: Install Wine and dependencies run: | sudo dpkg --add-architecture i386 sudo mkdir -pm755 /etc/apt/keyrings sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources sudo apt-get update sudo apt-get install -y --install-recommends winehq-stable sudo apt-get install -y wget unzip p7zip-full xvfb cabextract wine --version - name: Setup Xvfb for headless display run: | export DISPLAY=:99 Xvfb :99 -screen 0 1024x768x16 & sleep 2 echo "DISPLAY=:99" >> $GITHUB_ENV - name: Initialize Wine prefix run: | export WINEPREFIX=$HOME/.wine-eden export WINEARCH=win64 export WINEDEBUG=-all wineboot -u sleep 5 echo "WINEPREFIX=$HOME/.wine-eden" >> $GITHUB_ENV echo "WINEARCH=win64" >> $GITHUB_ENV echo "WINEDEBUG=-all" >> $GITHUB_ENV - name: Download and Install MSYS2 run: | # Download MSYS2 base wget https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20231026.tar.xz # Extract to Wine prefix mkdir -p $WINEPREFIX/drive_c/msys64 tar -xf msys2-base-x86_64-20231026.tar.xz -C $WINEPREFIX/drive_c/ # Setup MSYS2 environment echo "export MSYS2_PATH_TYPE=inherit" > $WINEPREFIX/drive_c/msys64/etc/profile.d/wine.sh ls -la $WINEPREFIX/drive_c/msys64/ - name: Initialize MSYS2 in Wine run: | # Run MSYS2 bash to initialize wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman-key --init" || true sleep 2 wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman-key --populate msys2" || true sleep 2 wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman -Sy --noconfirm" || true - name: Install MSYS2 Build Dependencies run: | # Install MinGW packages wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman -S --noconfirm --needed \ mingw-w64-x86_64-toolchain \ mingw-w64-x86_64-cmake \ mingw-w64-x86_64-ninja \ mingw-w64-x86_64-qt6-base \ mingw-w64-x86_64-qt6-tools \ mingw-w64-x86_64-qt6-translations \ mingw-w64-x86_64-qt6-svg \ mingw-w64-x86_64-boost \ mingw-w64-x86_64-fmt \ mingw-w64-x86_64-lz4 \ mingw-w64-x86_64-nlohmann-json \ mingw-w64-x86_64-openssl \ mingw-w64-x86_64-zlib \ mingw-w64-x86_64-zstd \ mingw-w64-x86_64-opus \ mingw-w64-x86_64-mbedtls \ mingw-w64-x86_64-libusb \ mingw-w64-x86_64-SDL2 \ mingw-w64-x86_64-vulkan-headers \ mingw-w64-x86_64-vulkan-loader \ mingw-w64-x86_64-glslang \ mingw-w64-x86_64-spirv-tools \ mingw-w64-x86_64-ffmpeg \ git \ make \ autoconf \ automake \ libtool \ patch \ python" || echo "Some packages may have failed to install" - name: Download Vulkan SDK for Windows run: | wget https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe -O vulkan-sdk.exe # Try silent install wine vulkan-sdk.exe /S || echo "Vulkan SDK install attempted" sleep 10 - name: Setup build script run: | cat > build-eden.sh << 'EOFSCRIPT' #!/bin/bash set -e export PATH="/c/msys64/mingw64/bin:/c/msys64/usr/bin:$PATH" export PKG_CONFIG_PATH="/c/msys64/mingw64/lib/pkgconfig" cd "$(pwd)" mkdir -p build-wine cd build-wine cmake .. \ -G "Ninja" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="/c/msys64/mingw64" \ -DYUZU_TESTS=OFF \ -DENABLE_QT=ON \ -DENABLE_QT_TRANSLATION=ON \ -DENABLE_SDL2=ON \ -DENABLE_WEB_SERVICE=ON \ -DYUZU_USE_QT_MULTIMEDIA=ON \ -DENABLE_LIBUSB=ON \ -DENABLE_OPENSSL=ON \ -DYUZU_USE_BUNDLED_QT=OFF \ -DYUZU_USE_BUNDLED_SDL2=OFF \ -DYUZU_USE_BUNDLED_FFMPEG=OFF \ -DYUZU_USE_CPM=ON ninja -j$(nproc) EOFSCRIPT chmod +x build-eden.sh - name: Build Eden in Wine run: | # Copy build script to Wine drive cp build-eden.sh $WINEPREFIX/drive_c/ # Copy source to Wine accessible location rsync -av --exclude='.git' --exclude='build*' ./ $WINEPREFIX/drive_c/eden-src/ # Run build cd $WINEPREFIX/drive_c/eden-src wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "/c/build-eden.sh" || echo "Build completed with potential errors" timeout-minutes: 120 continue-on-error: true - name: Package Windows Artifacts run: | mkdir -p artifacts-windows BUILD_DIR="$WINEPREFIX/drive_c/eden-src/build-wine/bin" if [ -d "$BUILD_DIR" ]; then # Copy executables find "$BUILD_DIR" -name "*.exe" -exec cp {} artifacts-windows/ \; 2>/dev/null || true # Copy DLLs find "$BUILD_DIR" -name "*.dll" -exec cp {} artifacts-windows/ \; 2>/dev/null || true # Copy Qt dependencies if eden.exe exists if [ -f artifacts-windows/eden.exe ]; then wine $WINEPREFIX/drive_c/msys64/mingw64/bin/windeployqt.exe artifacts-windows/eden.exe || true fi fi # Create version info echo "Eden Emulator - Windows Build (Wine + MSYS2)" > artifacts-windows/VERSION.txt echo "Build Date: $(date)" >> artifacts-windows/VERSION.txt echo "Commit: $(git rev-parse --short HEAD)" >> artifacts-windows/VERSION.txt echo "" >> artifacts-windows/VERSION.txt echo "Built using:" >> artifacts-windows/VERSION.txt echo "- Wine (Windows emulation on Linux)" >> artifacts-windows/VERSION.txt echo "- MSYS2 MinGW-w64 toolchain" >> artifacts-windows/VERSION.txt echo "- Qt6 for Windows" >> artifacts-windows/VERSION.txt echo "" >> artifacts-windows/VERSION.txt echo "Features:" >> artifacts-windows/VERSION.txt echo "- Qt GUI: Enabled" >> artifacts-windows/VERSION.txt echo "- SDL2: Enabled" >> artifacts-windows/VERSION.txt echo "- OpenSSL: Enabled" >> artifacts-windows/VERSION.txt echo "- Web Services: Enabled" >> artifacts-windows/VERSION.txt if [ ! -f artifacts-windows/eden.exe ] && [ ! -f artifacts-windows/eden-cmd.exe ]; then echo "" >> artifacts-windows/VERSION.txt echo "BUILD STATUS: FAILED - No executables produced" >> artifacts-windows/VERSION.txt echo "Check build logs for errors" >> artifacts-windows/VERSION.txt else echo "" >> artifacts-windows/VERSION.txt echo "BUILD STATUS: SUCCESS" >> artifacts-windows/VERSION.txt fi # Create archive cd artifacts-windows zip -r ../eden-windows-wine-msys2.zip . cd .. continue-on-error: true - name: Upload Windows Build if: always() uses: actions/upload-artifact@v4 with: name: eden-windows-wine-msys2 path: eden-windows-wine-msys2.zip retention-days: 30