name: Build Eden Emulator (Wine Native) on: push: branches: - dev workflow_dispatch: jobs: build-windows-wine: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Install Wine and Dependencies run: | sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install -y \ wget \ p7zip-full \ wine \ wine32 \ wine64 \ xvfb # Configure Wine export DISPLAY=:99 Xvfb :99 -screen 0 1024x768x16 & sleep 3 wineboot --init || true sleep 5 - name: Download Windows Tools run: | mkdir -p tools cd tools # Download LLVM-MinGW (Windows Toolchain) wget https://github.com/mstorsjo/llvm-mingw/releases/download/20240619/llvm-mingw-20240619-ucrt-x86_64.zip unzip -q llvm-mingw-20240619-ucrt-x86_64.zip mv llvm-mingw-20240619-ucrt-x86_64 llvm # Download CMake (Windows) wget https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-windows-x86_64.zip unzip -q cmake-3.29.2-windows-x86_64.zip mv cmake-3.29.2-windows-x86_64 cmake # Download Ninja (Windows) wget https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip unzip -q ninja-win.zip mkdir ninja mv ninja.exe ninja/ - name: Setup Environment run: | # Create a setup script to add tools to PATH in Wine echo "@echo off" > setup_env.bat echo "set PATH=Z:\home\runner\work\eden\eden\tools\llvm\bin;Z:\home\runner\work\eden\eden\tools\cmake\bin;Z:\home\runner\work\eden\eden\tools\ninja;%PATH%" >> setup_env.bat echo "set CC=clang" >> setup_env.bat echo "set CXX=clang++" >> setup_env.bat - name: Configure (Wine Native) env: DISPLAY: :99 run: | # We run cmake as if we are on Windows wine cmd /c "setup_env.bat && cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_OPENSSL=ON -DYUZU_USE_BUNDLED_FFMPEG=ON -DYUZU_USE_BUNDLED_SDL2=ON -DYUZU_USE_BUNDLED_QT=ON -DYUZU_USE_CPM=ON" - name: Build (Wine Native) env: DISPLAY: :99 run: | wine cmd /c "setup_env.bat && cmake --build build --config Release" - name: Prepare artifacts run: | mkdir -p artifacts # Copy the built executable if [ -f build/bin/eden.exe ]; then cp build/bin/eden.exe artifacts/ fi # Copy any additional runtime files if [ -d build/bin ]; then find build/bin -name "*.dll" -exec cp {} artifacts/ \; fi # Create a version file echo "Build Date: $(date)" > artifacts/build_info.txt echo "Commit: ${{ github.sha }}" >> artifacts/build_info.txt echo "Branch: ${{ github.ref_name }}" >> artifacts/build_info.txt - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: eden-windows-${{ github.sha }} path: artifacts/ retention-days: 30 - name: Upload executable only uses: actions/upload-artifact@v4 with: name: eden-windows-exe path: artifacts/eden.exe retention-days: 30 if: success() && hashFiles('artifacts/eden.exe') != ''