From 43558d9f060a3269dc48a464e93ca1a036997f2c Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Thu, 16 Nov 2023 17:56:54 +0100 Subject: [PATCH] ci: build mingw version of SporeModManager & SporeModLoader --- .github/workflows/build.yml | 46 ++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 254c0db..787a84a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: SporeModLoader on: [push, pull_request] jobs: - build: + msvc-build: runs-on: windows-2022 steps: - uses: actions/checkout@v4 @@ -16,19 +16,19 @@ jobs: run: | $env:revision = git describe --tags --always echo "GIT_REVISION=$env:revision" >> $env:GITHUB_ENV - - name: Build SporeModLoader + - name: Build SporeModLoader (msvc) run: | msbuild "SporeModLoader" ` /p:Configuration=Release ` /p:Platform=Win32 ` /m - - name: Build SporeModManager + - name: Build SporeModManager (msvc) run: | msbuild "SporeModManager" ` /p:Configuration=Release ` /p:Platform=Win32 ` /m - - name: Package SporeModLoader + - name: Package SporeModLoader (msvc) run: | New-Item -ItemType Directory -Force -Path bin\SporebinEP1 New-Item -ItemType Directory -Force -Path bin\SporeModLoader\CoreLibs\disk @@ -45,11 +45,22 @@ jobs: Copy "SporeModLoader\Bin\Release\dinput8.dll" "bin\SporebinEP1\dinput8.dll" Copy "SporeModManager\Bin\Release\SporeModManager.exe" "bin\SporeModLoader\SporeModManager\SporeModManager.exe" - - name: Upload SporeModLoader + - name: Upload SporeModLoader (msvc) uses: actions/upload-artifact@v3 with: name: SporeModLoader-${{ env.GIT_REVISION }} path: bin/* + # the modapi dlls cannot be compiled using mingw + # due to needing to keep ABI compatability with + # existing mods compiled with msvc + - name: Upload SporeModLoader (modapi dlls for mingw) + uses: actions/upload-artifact@v3 + with: + name: SporeModLoader-mingw-${{ env.GIT_REVISION }} + path: | + bin/* + !bin/SporebinEP1/dinput8.dll + !bin/SporeModLoader/SporeModManager/SporeModManager.exe linux-build: runs-on: ubuntu-20.04 steps: @@ -61,9 +72,32 @@ jobs: echo "GIT_REVISION=$(git describe --tags --always)" >> $GITHUB_ENV - name: Build SporeModManager (Linux) run: | - make BINARY_DIR=bin/SporeModLoader/SporeModManager -j$(nproc) + make SporeModManager -j$(nproc) - name: Upload SporeModLoader (Linux) uses: actions/upload-artifact@v3 with: name: SporeModLoader-${{ env.GIT_REVISION }} path: bin/* + mingw-build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Install Packages + run: | + sudo apt-get -y install gcc-mingw-w64-i686 g++-mingw-w64-i686 + - name: Prepare Environment + run: | + echo "GIT_REVISION=$(git describe --tags --always)" >> $GITHUB_ENV + - name: Build SporeModLoader (mingw) + run: | + make SporeModLoader -j$(nproc) + - name: Build SporeModManager (mingw) + run: | + make SporeModManager.exe -j$(nproc) + - name: Upload SporeModLoader (mingw) + uses: actions/upload-artifact@v3 + with: + name: SporeModLoader-mingw-${{ env.GIT_REVISION }} + path: bin/*