diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index c09df11..b1926fa 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -103,84 +103,61 @@ jobs: files: wownero-lws-linux.zip build-windows: - runs-on: windows-latest + # We use the Linux runner because that is where Docker is installed and where + # we can run the Linux-based cross-compilation toolchain. + runs-on: ubuntu-latest steps: - name: Manual Checkout (LAN) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + # NOTE: 'rm -rf *' wipes the workspace. This ensures a clean build but + # deletes the cached 'depends' folder, forcing a Boost rebuild every time. + # If builds are too slow, we can optimize this later. + echo "Cleaning workspace..." rm -rf * + + # Clone from Mac's LAN IP (Matches your logic in build-linux) git clone http://oauth2:$GITHUB_TOKEN@192.168.88.230:3000/${{ github.repository }}.git . git config --global url."https://github.com/".insteadOf "git@github.com:" + git config --global url."https://codeberg.org/".insteadOf "git@codeberg.org:" + echo "Initializing submodules..." git submodule update --init --recursive - # --- 1. CLEANUP --- - - name: Clean Environment + - name: Build Windows via Docker + # We use the 'wownero-builder' image you created. + # We mount the current directory ($PWD) to /source so artifacts are saved to the host. run: | - echo "Cleaning build environment..." - rm -rf external/monero/contrib/depends/work/build/x86_64-w64-mingw32/boost - rm -rf external/monero/contrib/depends/built/x86_64-w64-mingw32/boost - rm -rf external/monero/contrib/depends/work/download/boost* - rm -rf external/monero/contrib/depends/packages/boost - - # --- 2. UPGRADE BOOST 1.80 --- - - name: Configure Boost 1.80.0 - run: | - BOOST_MK="external/monero/contrib/depends/packages/boost.mk" - - # 1. Update Version and Hash - sed -i 's/1_69_0/1_80_0/g' $BOOST_MK - sed -i 's/1.69.0/1.80.0/g' $BOOST_MK - sed -i 's/sha256_hash=.*$/sha256_hash=4b2136f98bdd1f5857f1c3dea9ac2018effe65286cf251534b6ae20cc45e1847/g' $BOOST_MK - - # 2. Add Context/Coroutine libraries - sed -i 's/chrono,/chrono,context,coroutine,/g' $BOOST_MK - - # --- 3. THE PHANTOM PATCH (The Ultimate Fix) --- - - name: Install Phantom Patch Tool - run: | - # 1. Create a dummy patch directory to satisfy "No such file" checks - mkdir -p external/monero/contrib/depends/packages/boost - - # 2. Create empty dummy files for KNOWN old patches to prevent file-read errors - # We just blindly touch them so they exist. - touch external/monero/contrib/depends/packages/boost/fix_aroptions.patch - touch external/monero/contrib/depends/packages/boost/boost_1_80_0_gcc.patch - - # 3. Create the Fake Patch Command - # This script ignores all input and returns Success (0) - mkdir -p $HOME/fake-bin - echo '#!/bin/sh' > $HOME/fake-bin/patch - echo 'echo "Phantom Patch: Ignoring patch request."' >> $HOME/fake-bin/patch - echo 'exit 0' >> $HOME/fake-bin/patch - chmod +x $HOME/fake-bin/patch - - # 4. Add to PATH so it overrides the system 'patch' - echo "$HOME/fake-bin" >> $GITHUB_PATH - - # --- 4. BUILD DEPENDENCIES --- - - name: Build Windows Dependencies - run: | - cd external/monero/contrib/depends - # We simply run make. Our fake 'patch' tool intercepts the calls. - make HOST=x86_64-w64-mingw32 -j$(nproc) - - # --- 5. PATCH APP CODE --- - - name: Patch App Source Code - run: | - echo "Fixing missing include for GCC 13..." - sed -i 's/#include /#include \n#include /' external/monero/contrib/epee/include/net/http_base.h - - # --- 6. COMPILE APP --- - - name: Build Windows (Cross-Compile) - run: | - mkdir build && cd build - cmake .. -DCMAKE_TOOLCHAIN_FILE=../external/monero/contrib/depends/x86_64-w64-mingw32/share/toolchain.cmake -DCMAKE_BUILD_TYPE=Release - make -j$(nproc) + echo "Starting Docker Build..." + docker run --rm \ + -v "$PWD:/source" \ + -w /source \ + wownero-builder \ + /bin/bash -c " + set -e + + # 1. Build Dependencies (Boost, OpenSSL, etc.) + # This runs the standard Monero cross-compile setup + echo 'Building Dependencies...' + cd external/monero/contrib/depends + make HOST=x86_64-w64-mingw32 -j$(nproc) + + # 2. Configure Project + # We use the toolchain file generated by step 1 + echo 'Configuring Project...' + cd ../../../.. + mkdir -p build && cd build + cmake .. -DCMAKE_TOOLCHAIN_FILE=../external/monero/contrib/depends/x86_64-w64-mingw32/share/toolchain.cmake -DCMAKE_BUILD_TYPE=Release + + # 3. Compile the actual application + echo 'Compiling...' + make -j$(nproc) + " - name: Package Windows run: | cd build/src + # The .exe files were created by the docker container and exist on the host now zip ../../wownero-lws-windows.zip wownero-lws-daemon.exe wownero-lws-admin.exe wownero-lws-client.exe - name: Upload Windows Artifact