From 229c4abc0f9db3649aa20ddf4ed1dd30f6208393 Mon Sep 17 00:00:00 2001 From: OusmBlueNinja <89956790+OusmBlueNinja@users.noreply.github.com> Date: Fri, 3 Jan 2025 20:52:06 -0600 Subject: [PATCH] I dont have a windows runner.... --- .gitea/workflows/build-DEBUG-windows.yml | 68 +++++++++++++++--------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/build-DEBUG-windows.yml b/.gitea/workflows/build-DEBUG-windows.yml index 861cba5..9e9b770 100644 --- a/.gitea/workflows/build-DEBUG-windows.yml +++ b/.gitea/workflows/build-DEBUG-windows.yml @@ -1,4 +1,4 @@ -name: Build (Windows) +name: Build (Windows Cross-Compile on Ubuntu) on: push: @@ -6,41 +6,59 @@ on: - main jobs: - build_release: - runs-on: windows-latest + build_windows: + runs-on: ubuntu-latest steps: - name: Check out repository (recursively with submodules) uses: actions/checkout@v3 with: - submodules: true # Ensures submodules are cloned - fetch-depth: 0 # Optional, fetches entire repo history + submodules: true + fetch-depth: 0 - - name: Set up MSYS2 - uses: msys2/setup-msys2@v2 - with: - update: true - - - name: Install dependencies (MSYS2/MinGW) - shell: msys2 {0} + - name: Install cross-compile toolchain & libs run: | - pacman -S --noconfirm \ - make \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-cmake \ - mingw-w64-x86_64-glew \ - mingw-w64-x86_64-glfw \ - mingw-w64-x86_64-yaml-cpp \ - mingw-w64-x86_64-lua + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + mingw-w64 \ + pkg-config-mingw-w64-x86-64 \ + cmake - - name: Build - shell: msys2 {0} + # Attempt to install cross-compiled dependencies. + # NOTE: Some of these may not be available on your Ubuntu version. + # If "Unable to locate package ..." occurs, remove or handle them. + sudo apt-get install -y \ + mingw-w64-x86-64-glew \ + mingw-w64-x86-64-glfw \ + mingw-w64-x86-64-yaml-cpp \ + mingw-w64-x86-64-lua5.3 + + - name: Build for Windows with MinGW run: | - make clean - make + # Clean old artifacts (if your Makefile supports it) + make clean || true + + # Cross-compile using the MinGW-w64 toolchain + # Override CC/CXX so Make uses x86_64-w64-mingw32-gcc/g++ + make \ + CC=x86_64-w64-mingw32-gcc \ + CXX=x86_64-w64-mingw32-g++ \ + LD=x86_64-w64-mingw32-ld + + # If your Makefile automatically detects the MinGW environment, + # you may not need these overrides. + + - name: Prepare release folder + run: | + mkdir -p release + # Example: if your Makefile produces "TesseractEngine.exe" in root or build/ + # Copy it into the release folder for artifact uploading + cp TesseractEngine.exe release/ || true + cp build/TesseractEngine.exe release/ || true - name: Upload release artifacts uses: actions/upload-artifact@v2 with: - name: TesseractEngine(Windows)(DEBUG)(TIMERS) + name: TesseractEngine-WinCross path: release