mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-11 08:05:16 -08:00
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -103,84 +103,61 @@ jobs:
|
|||||||
files: wownero-lws-linux.zip
|
files: wownero-lws-linux.zip
|
||||||
|
|
||||||
build-windows:
|
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:
|
steps:
|
||||||
- name: Manual Checkout (LAN)
|
- name: Manual Checkout (LAN)
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
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 *
|
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 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://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
|
git submodule update --init --recursive
|
||||||
|
|
||||||
# --- 1. CLEANUP ---
|
- name: Build Windows via Docker
|
||||||
- name: Clean Environment
|
# We use the 'wownero-builder' image you created.
|
||||||
|
# We mount the current directory ($PWD) to /source so artifacts are saved to the host.
|
||||||
run: |
|
run: |
|
||||||
echo "Cleaning build environment..."
|
echo "Starting Docker Build..."
|
||||||
rm -rf external/monero/contrib/depends/work/build/x86_64-w64-mingw32/boost
|
docker run --rm \
|
||||||
rm -rf external/monero/contrib/depends/built/x86_64-w64-mingw32/boost
|
-v "$PWD:/source" \
|
||||||
rm -rf external/monero/contrib/depends/work/download/boost*
|
-w /source \
|
||||||
rm -rf external/monero/contrib/depends/packages/boost
|
wownero-builder \
|
||||||
|
/bin/bash -c "
|
||||||
|
set -e
|
||||||
|
|
||||||
# --- 2. UPGRADE BOOST 1.80 ---
|
# 1. Build Dependencies (Boost, OpenSSL, etc.)
|
||||||
- name: Configure Boost 1.80.0
|
# This runs the standard Monero cross-compile setup
|
||||||
run: |
|
echo 'Building Dependencies...'
|
||||||
BOOST_MK="external/monero/contrib/depends/packages/boost.mk"
|
cd external/monero/contrib/depends
|
||||||
|
make HOST=x86_64-w64-mingw32 -j$(nproc)
|
||||||
|
|
||||||
# 1. Update Version and Hash
|
# 2. Configure Project
|
||||||
sed -i 's/1_69_0/1_80_0/g' $BOOST_MK
|
# We use the toolchain file generated by step 1
|
||||||
sed -i 's/1.69.0/1.80.0/g' $BOOST_MK
|
echo 'Configuring Project...'
|
||||||
sed -i 's/sha256_hash=.*$/sha256_hash=4b2136f98bdd1f5857f1c3dea9ac2018effe65286cf251534b6ae20cc45e1847/g' $BOOST_MK
|
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
|
||||||
|
|
||||||
# 2. Add Context/Coroutine libraries
|
# 3. Compile the actual application
|
||||||
sed -i 's/chrono,/chrono,context,coroutine,/g' $BOOST_MK
|
echo 'Compiling...'
|
||||||
|
make -j$(nproc)
|
||||||
# --- 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 <cstdint> include for GCC 13..."
|
|
||||||
sed -i 's/#include <list>/#include <list>\n#include <cstdint>/' 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)
|
|
||||||
|
|
||||||
- name: Package Windows
|
- name: Package Windows
|
||||||
run: |
|
run: |
|
||||||
cd build/src
|
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
|
zip ../../wownero-lws-windows.zip wownero-lws-daemon.exe wownero-lws-admin.exe wownero-lws-client.exe
|
||||||
|
|
||||||
- name: Upload Windows Artifact
|
- name: Upload Windows Artifact
|
||||||
|
|||||||
Reference in New Issue
Block a user