mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
commit
2c72e3de6d
55
.github/workflows/build-linux.yml
vendored
55
.github/workflows/build-linux.yml
vendored
|
|
@ -22,17 +22,58 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install system dependencies
|
||||||
uses: cachix/install-nix-action@v31
|
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:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
path: ~/.ccache
|
||||||
|
key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }}
|
||||||
|
|
||||||
- name: Build
|
- name: Restore meson cache
|
||||||
run: nix build --print-build-logs
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cache/meson
|
||||||
|
key: ${{ runner.os }}-meson-${{ hashFiles('**/meson.build') }}
|
||||||
|
|
||||||
- name: Flake integrity
|
- name: Configure Meson
|
||||||
run: nix flake check
|
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