From 5ed954575e9a94ff175599e9b83e0387c5e3f744 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 4 Jan 2025 23:19:19 +0100 Subject: [PATCH] Introduce w64-mingw32 workflows - build-3rdparty.yml cross-builds all third-party dependencies for Windows. This workflow is meant to be run only sparingly, since it fetches source code from many repositories and takes a long time to build. - build-w64-mingw32.yml cross-builds the game engine and tools for Windows. It requires a pre-existing build of the third-party libraries. --- .forgejo/workflows/build-3rdparty.yml | 25 +++++++++++++++ .forgejo/workflows/build-w64-mingw32.yml | 39 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .forgejo/workflows/build-3rdparty.yml create mode 100644 .forgejo/workflows/build-w64-mingw32.yml diff --git a/.forgejo/workflows/build-3rdparty.yml b/.forgejo/workflows/build-3rdparty.yml new file mode 100644 index 000000000..874f1f88f --- /dev/null +++ b/.forgejo/workflows/build-3rdparty.yml @@ -0,0 +1,25 @@ +on: + pull_request: + paths: + - '/packaging/3rdParty-devel/**' + workflow_dispatch: + +jobs: + build: + runs-on: docker + container: + image: forge.a-lec.org/speed-dreams/debian-i686-w64-mingw32:stable + steps: + - name: Clone repository + run: | + git clone \ + -b ${{ env.GITHUB_HEAD_REF }} \ + --depth 1 \ + '${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }}.git' \ + /src + - name: Configure third-party libraries + run: cmake -B build -DCMAKE_TOOLCHAIN_FILE=x86_64-w64-mingw32.cmake + working-directory: /src/packaging/3rdParty-devel + - name: Build third-party libraries + run: cmake --build build -j$(nproc --all) + working-directory: /src/packaging/3rdParty-devel diff --git a/.forgejo/workflows/build-w64-mingw32.yml b/.forgejo/workflows/build-w64-mingw32.yml new file mode 100644 index 000000000..8bed49e85 --- /dev/null +++ b/.forgejo/workflows/build-w64-mingw32.yml @@ -0,0 +1,39 @@ +on: [pull_request] +jobs: + build: + runs-on: docker + container: + image: forge.a-lec.org/speed-dreams/debian-i686-w64-mingw32:stable + steps: + - name: Download 3rdParty libraries + run: | + curl -O 3rdparty.zip "${{ vars.THIRDPARTY_URL }}" + - name: Unzip 3rdParty libraries + run: | + unzip 3rdparty.zip -d /3rdparty + - name: Clone repository + run: | + git clone \ + -b ${{ env.GITHUB_HEAD_REF }} \ + --depth 1 \ + ${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }}.git \ + /src + - name: Configure project + run: cmake -B build \ + -DSD_ASSUME_DATADIR=1 \ + -DCMAKE_FIND_ROOT_PATH=/3rdparty \ + -DCMAKE_TOOLCHAIN_FILE=packaging/3rdParty-devel/i686-w64-mingw32.cmake + working-directory: /src + - name: Build project + run: cmake --build build -j$(nproc --all) + working-directory: /src + - name: Build installer + run: cpack -G NSIS + working-directory: /src/build + - name: Upload installer + run: upload-artifact *.exe + working-directory: /src/build + env: + URL: ${{ vars.STORE_URL }} + USERNAME: ${{ secrets.STORE_USERNAME }} + PASSWORD: ${{ secrets.STORE_PASSWORD }}