Add Windows cross-compilation via MinGW, and fix Docker build permission
build / build (push) Successful in 3m5s
build / build (push) Successful in 3m5s
issues on vboxsf-mounted checkouts New `make dist-win`/`package-win` targets (folded into `dist`/`package` alongside the renamed `dist-linux`/`package-linux`) cross-compile systemshock.exe via MinGW, using prebuilt SDL2/SDL2_mixer/GLEW/ fluidsynth-lite baked into the build-image - no Windows machine or Wine needed to build it, confirmed working and playable on a real Windows machine. dist-win/ ships DLLs flat alongside the exe plus a new res/run.bat launcher, packaged into a .zip the same way dist/ becomes a .tar.gz. Also fixes three build-image bugs hit while testing on a VirtualBox vboxsf-mounted checkout: build-engine.sh/docker-entrypoint.sh losing their execute bit (chmod +x on restrictive source perms), the container user missing access to /workspace's supplementary vboxsf group, and cp -a failing on symlink/hard-link creation (vboxsf doesn't support either) - now falls back to dereferencing copies when detected. Also adds Docker/zip/etc. prerequisites to the README for both the desktop and Quest builds.
This commit is contained in:
+19
-10
@@ -1,14 +1,16 @@
|
||||
name: build
|
||||
|
||||
# Builds a versioned Linux release tarball (see `make package`) on every
|
||||
# push/PR, plus on-demand via the Gitea "Run workflow" button. Runs
|
||||
# Builds versioned Linux and Windows release packages (see `make
|
||||
# package`, which builds both - a .tar.gz and a .zip) on every push/PR,
|
||||
# plus on-demand via the Gitea "Run workflow" button. Runs
|
||||
# inside the build-image (see ../../build-image/Dockerfile, built/pushed
|
||||
# via ../../build-image.sh and ../../upload-image.sh), which bundles
|
||||
# every dependency engine/ needs to compile - no network access needed
|
||||
# at job runtime. Since the job's container already *is* the build-image
|
||||
# (QUESTSHOCK_BUILD_IMAGE=1), `make package`'s `engine` prerequisite
|
||||
# compiles directly instead of trying to docker-run it again, which
|
||||
# wouldn't work here (no nested docker).
|
||||
# every dependency engine/ needs to compile (for both platforms,
|
||||
# including the Windows cross-toolchain) - no network access needed at
|
||||
# job runtime. Since the job's container already *is* the build-image
|
||||
# (QUESTSHOCK_BUILD_IMAGE=1), `make package`'s `engine`/`engine-win`
|
||||
# prerequisites compile directly instead of trying to docker-run it
|
||||
# again, which wouldn't work here (no nested docker).
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
@@ -50,17 +52,22 @@ jobs:
|
||||
# comment) - openxr was added to this image in the same
|
||||
# Android/Quest layer, so it's an equally good marker of that.
|
||||
[ -d /opt/prebuilt/android/openxr ] || { echo "PREFLIGHT FAIL: /opt/prebuilt/android/openxr missing - runner is using a build-image older than the Android/Quest layer" >&2; exit 1; }
|
||||
[ -d /opt/prebuilt/win/sdl2 ] || { echo "PREFLIGHT FAIL: /opt/prebuilt/win/sdl2 missing - runner is using a build-image older than the Windows cross-build layer" >&2; exit 1; }
|
||||
command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1 || { echo "PREFLIGHT FAIL: x86_64-w64-mingw32-gcc not in PATH" >&2; exit 1; }
|
||||
command -v zip >/dev/null 2>&1 || { echo "PREFLIGHT FAIL: zip not in PATH (needed by make package-win)" >&2; exit 1; }
|
||||
|
||||
- name: Build package
|
||||
run: make package
|
||||
|
||||
- name: Upload build artifact
|
||||
- name: Upload build artifacts
|
||||
# v4 uses the newer @actions/artifact backend, which this Gitea
|
||||
# instance's artifact storage doesn't support (GHESNotSupportedError) - v3 works.
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: shockolate
|
||||
path: dist/shockolate-*-linux-*.tar.gz
|
||||
path: |
|
||||
dist/shockolate-*-linux-*.tar.gz
|
||||
dist/shockolate-*-windows-*.zip
|
||||
|
||||
- name: Build Quest APK
|
||||
# QUESTSHOCK_BUILD_IMAGE is already set (see Preflight above), so
|
||||
@@ -78,13 +85,14 @@ jobs:
|
||||
path: dist/questshock-*-android-*.apk
|
||||
|
||||
- name: Publish to dl.ladkau.de
|
||||
# Uploads the tarball and APK over SFTP instead of using
|
||||
# Uploads the tarball, zip, and APK over SFTP instead of using
|
||||
# actions/upload-artifact (whose zip wrapping can't be disabled).
|
||||
# Only runs on push so PR builds don't publish.
|
||||
if: gitea.event_name == 'push'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TARBALL="$(ls dist/shockolate-*-linux-*.tar.gz)"
|
||||
ZIP="$(ls dist/shockolate-*-windows-*.zip)"
|
||||
APK="$(ls dist/questshock-*-android-*.apk)"
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.DL_SFTP_KEY }}" > ~/.ssh/dl_sftp_key
|
||||
@@ -94,5 +102,6 @@ jobs:
|
||||
uploader@dl.ladkau.de <<EOF
|
||||
-mkdir files/questshock
|
||||
put $TARBALL files/questshock/$(basename "$TARBALL")
|
||||
put $ZIP files/questshock/$(basename "$ZIP")
|
||||
put $APK files/questshock/$(basename "$APK")
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user