Files
eden/.gitea/workflows/build.yml
ovosimpatico a7f03402cd
Some checks failed
Build Eden Emulator (Wine Native) / build-windows-wine (push) Failing after 14m6s
14
2025-12-27 07:06:04 -03:00

148 lines
5.2 KiB
YAML

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 \
winbind \
zstd
# 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/
# Download BusyBox (provides patch, tar, etc.)
mkdir -p utils
wget https://frippery.org/files/busybox/busybox.exe -O utils/busybox.exe
cp utils/busybox.exe utils/patch.exe
cp utils/busybox.exe utils/tar.exe
cp utils/busybox.exe utils/unzip.exe
cp utils/busybox.exe utils/sh.exe
# Download Python (Windows Embeddable)
wget https://www.python.org/ftp/python/3.12.3/python-3.12.3-embed-amd64.zip
unzip -q python-3.12.3-embed-amd64.zip -d python
# Enable site-packages in embeddable python (needed for some scripts)
sed -i 's/#import site/import site/' python/python312._pth
# Download libiconv (needed for FFmpeg)
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-libiconv-1.18-1-any.pkg.tar.zst
# Extract zst using tar (if system tar supports it) or zstd
# We installed p7zip-full, but tar with zstd is cleaner if available.
# Let's install zstd in the apt step.
tar -I zstd -xf mingw-w64-x86_64-libiconv-1.18-1-any.pkg.tar.zst -C tools/
# The package extracts to mingw64/, move it to iconv/
mv tools/mingw64 tools/iconv
- name: Setup Environment and Scripts
run: |
# Patch libusb CMakeLists.txt to use native CMake build instead of autoconf on MinGW
sed -i 's/if (MINGW OR PLATFORM_LINUX OR APPLE)/if (PLATFORM_LINUX OR APPLE)/' externals/libusb/CMakeLists.txt
# Create configure script
echo "@echo off" > configure.bat
echo "set PATH=tools\llvm\bin;tools\cmake\bin;tools\ninja;tools\python;tools\utils;%PATH%" >> configure.bat
echo "set CC=clang" >> configure.bat
echo "set CXX=clang++" >> configure.bat
echo "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 -DCMAKE_PREFIX_PATH=\"tools\llvm\x86_64-w64-mingw32;tools\iconv\"" >> configure.bat
# Create build script
echo "@echo off" > build_eden.bat
echo "set PATH=tools\llvm\bin;tools\cmake\bin;tools\ninja;tools\python;tools\utils;%PATH%" >> build_eden.bat
echo "cmake --build build --config Release" >> build_eden.bat
- name: Configure (Wine Native)
env:
DISPLAY: :99
run: |
wine cmd /c configure.bat
- name: Build (Wine Native)
env:
DISPLAY: :99
run: |
wine cmd /c build_eden.bat
- 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') != ''