Build WinXP (i686 static) #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build WinXP (i686 static) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: "Git ref to build (tag/branch/commit)" | |
| required: false | |
| default: "winxp" | |
| push: | |
| tags: | |
| - "v*" | |
| - "winxp-*" | |
| jobs: | |
| mxe: | |
| uses: ./.github/workflows/build-mxe.yml | |
| with: | |
| MXE_VERSION: "7e39b555dee5e906b24a44940055dc28d4056d23" | |
| GCC_VERSION: "11" | |
| build: | |
| runs-on: ubuntu-latest | |
| container: ubuntu:20.04 | |
| needs: [mxe] | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Install build tools | |
| run: | | |
| apt-get update | |
| DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
| git make zip ca-certificates | |
| - name: Select ref | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.ref }}" ]; then | |
| REF="${{ github.event.inputs.ref }}" | |
| else | |
| REF="${GITHUB_REF_NAME}" | |
| fi | |
| echo "REF=$REF" >> $GITHUB_ENV | |
| SAFE_REF="$(echo "$REF" | tr '/:' '__')" | |
| echo "SAFE_REF=$SAFE_REF" >> $GITHUB_ENV | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.REF }} | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Restore MXE cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: mxe | |
| key: ${{ runner.os }}-mxe-v7e39b555dee5e906b24a44940055dc28d4056d23-gcc11-jsoncpp-sdl_net-v7 | |
| - name: Configure + build (WinXP) | |
| run: | | |
| set -euxo pipefail | |
| export PATH="$GITHUB_WORKSPACE/mxe/usr/bin:$PATH" | |
| export MXE_PREFIX="$GITHUB_WORKSPACE/mxe/usr/i686-w64-mingw32.static" | |
| # Make pkg-config resolve MXE packages (not host) | |
| export PKG_CONFIG_PATH="$MXE_PREFIX/lib/pkgconfig" | |
| export PKG_CONFIG_LIBDIR="$MXE_PREFIX/lib/pkgconfig" | |
| echo "=== DEBUG: MXE_PREFIX ===" | |
| echo "$MXE_PREFIX" | |
| echo "=== DEBUG: SDL_net headers (try common locations) ===" | |
| ls -la "$MXE_PREFIX/include/SDL_net.h" || true | |
| ls -la "$MXE_PREFIX/include/SDL/SDL_net.h" || true | |
| ls -la "$MXE_PREFIX/include/SDL_net/SDL_net.h" || true | |
| echo "=== DEBUG: jsoncpp headers (try common locations) ===" | |
| ls -la "$MXE_PREFIX/include/json/json.h" || true | |
| ls -la "$MXE_PREFIX/include/jsoncpp/json/json.h" || true | |
| echo "=== DEBUG: key libs present in MXE_PREFIX/lib ===" | |
| ls -la "$MXE_PREFIX/lib" | grep -Ei "json|sdl|jpeg|png|webp|smpeg|modplug|vorbis|ogg|ws2|iphlp|winmm|dxguid" || true | |
| rm -rf build | |
| mkdir -p build | |
| cd build | |
| i686-w64-mingw32.static-cmake \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DDEV_BUILD=OFF \ | |
| -DBUILD_PACKAGE=OFF \ | |
| -DCMAKE_PREFIX_PATH="$MXE_PREFIX" \ | |
| -DDEPS_DIR= \ | |
| "$GITHUB_WORKSPACE" | |
| make -j"$(nproc)" VERBOSE=1 | |
| # Always upload link scripts (even if build fails) | |
| - name: Upload link scripts (link.txt + linklibs.rsp) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: winxp-link-scripts-${{ env.SAFE_REF }} | |
| path: | | |
| build/src/CMakeFiles/openxcom.dir/link.txt | |
| build/src/CMakeFiles/openxcom.dir/linklibs.rsp | |
| build/CMakeFiles/CMakeOutput.log | |
| - name: Package zip | |
| if: success() | |
| run: | | |
| cd build/bin | |
| rm -f libopenxcom.dll.a || true | |
| zip -r "../../openxcom-winxp-${{ env.SAFE_REF }}.zip" . | |
| - name: Upload artifact | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: openxcom-winxp-${{ env.SAFE_REF }} | |
| path: openxcom-winxp-${{ env.SAFE_REF }}.zip |