mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-11 09:49:19 +00:00
commit
2c72e3de6d
55
.github/workflows/build-linux.yml
vendored
55
.github/workflows/build-linux.yml
vendored
|
|
@ -22,17 +22,58 @@ on:
|
|||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential ccache python3 python3-pip ninja-build libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev libglm-dev
|
||||
python -m pip install meson
|
||||
# Set a reasonable ccache size
|
||||
ccache -M 5G || true
|
||||
python -m pip install meson
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
path: ~/.ccache
|
||||
key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }}
|
||||
|
||||
- name: Build
|
||||
run: nix build --print-build-logs
|
||||
- name: Restore meson cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/meson
|
||||
key: ${{ runner.os }}-meson-${{ hashFiles('**/meson.build') }}
|
||||
|
||||
- name: Flake integrity
|
||||
run: nix flake check
|
||||
- name: Configure Meson
|
||||
env:
|
||||
CC: "ccache clang"
|
||||
CXX: "ccache clang++"
|
||||
CCACHE_DIR: ${{ runner.temp }}/ccache
|
||||
run: |
|
||||
mkdir -p "$CCACHE_DIR"
|
||||
export CCACHE_DIR="$CCACHE_DIR"
|
||||
meson setup build --wipe --native-file=./scripts/llvm_native.txt
|
||||
|
||||
- name: Build with Meson
|
||||
env:
|
||||
CC: "ccache clang"
|
||||
CXX: "ccache clang++"
|
||||
CCACHE_DIR: ${{ runner.temp }}/ccache
|
||||
run: |
|
||||
export CCACHE_DIR="${{ runner.temp }}/ccache"
|
||||
# Use all available cores for faster parallel builds
|
||||
meson compile -C build -j $(nproc) -v Minecraft.Client
|
||||
|
||||
- name: Install patchelf
|
||||
run: sudo apt-get install -y patchelf
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: minecraft-client-linux-${{ github.sha }}
|
||||
path: build/Minecraft.Client/Minecraft.Client
|
||||
retention-days: 7
|
||||
Loading…
Reference in a new issue