GHA: Add win64 cross compile build

This also removes -t from docker run, as we don't actually require a
terminal, this was just muscle memory.

This also archives the artifacts for testing.
develop
Kelvie Wong 2023-01-24 16:17:49 -08:00
parent 5283cb1e72
commit a72b26c4f2
2 changed files with 26 additions and 2 deletions

@ -125,6 +125,29 @@ jobs:
run: |
rm -rf "$DF_FOLDER"
build-cross-win64:
name: Build MSVC win64
runs-on: ubuntu-22.04
steps:
- name: Clone DFHack
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Cross-compile win64 artifacts
run: |
cd build
bash -x build-win64-from-linux.sh
- name: Format artifact name
id: artifactname
run: |
echo name=$(date +%Y%m%d)-$(git rev-parse --short $GITHUB_REF) >> $GITHUB_OUTPUT
- name: Upload win64 artifacts
uses: actions/upload-artifact@v3
with:
name: dfhack-win64-build-${{ steps.artifactname.outputs.name }}
path: build/win64-cross/output/*
docs:
runs-on: ubuntu-18.04
steps:

@ -37,10 +37,11 @@ fi
#
# NOTE: win64-cross is mounted in /src/build due to the hardcoded `cmake ..` in
# the Dockerfile
if ! docker run --rm -it -v "$srcdir":/src -v "$srcdir/build/win64-cross/":/src/build \
if ! docker run --rm -i -v "$srcdir":/src -v "$srcdir/build/win64-cross/":/src/build \
-e BUILDER_UID=$builder_uid \
--name dfhack-win \
dfhack-build-msvc bash -c "cd /src/build && dfhack-configure windows 64 Release -DCMAKE_INSTALL_PREFIX=/src/build/output cmake .. -DBUILD_DOCS=1 && dfhack-make -j$jobs install" \
ghcr.io/dfhack/build-env:msvc \
bash -c "cd /src/build && dfhack-configure windows 64 Release -DCMAKE_INSTALL_PREFIX=/src/build/output cmake .. -DBUILD_DOCS=1 && dfhack-make -j$jobs install" \
; then
echo
echo "Build failed"