add linux build workflow

This commit is contained in:
halogen 2026-03-06 21:51:35 -05:00
parent 09bbff8e7d
commit 4405162814

55
.github/workflows/build_linux.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: Build Minecraft Legacy Console Edition (Linux)
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container:
image: archlinux:latest
strategy:
matrix:
configuration: [Release, Debug]
steps:
- name: Install base dependencies
run: |
pacman -Syu --noconfirm archlinux-keyring
pacman -Syu --noconfirm base-devel sudo git clang lld ninja cmake extra-cmake-modules python wine msitools ca-certificates libwbclient
- name: Create build user
run: |
useradd -m builder
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
- name: Checkout repository
uses: actions/checkout@v4
- name: Fix permissions
run: chown -R builder:builder .
- name: Build
run: |
sudo -u builder sh <<'EOF'
set -e
mkdir build
cd build
export WINDOWS_SDK_PATH="$PWD/my_msvc"
export WINE=$(command -v wine64 || command -v wine || false)
$WINE wineboot
git clone https://github.com/mstorsjo/msvc-wine
./msvc-wine/vsdownload.py --accept-license --dest $(pwd)/my_msvc
./msvc-wine/install.sh $(pwd)/my_msvc
export PATH=$(pwd)/my_msvc/bin/x64:$PATH
cmake .. -B . -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DWINDOWS_SDK_PATH=$(pwd)/my_msvc -DCMAKE_TOOLCHAIN_FILE=./toolchain-linux-winsdk.cmake
ninja
EOF
- name: Upload Release + Debug Artifacts
uses: actions/upload-artifact@v4
with:
name: MinecraftClient-${{ matrix.configuration }}
path: build