feat(CI): add nightly build workflow (#390)

* feat(CI): add nightly build workflow

* ci: trigger nightly

* ci: workflow dispatch

* ci: oh god

* fix(ci): build the whole game not just the executable
This commit is contained in:
/home/neo 2026-04-03 10:13:30 +03:00 committed by GitHub
parent bd87f4d245
commit 74db007403
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

87
.github/workflows/release-linux.yml vendored Normal file
View file

@ -0,0 +1,87 @@
name: Nightly (Linux, x86-64)
on:
push:
paths: &workflow_paths
- '**.cpp'
- '**.h'
- '**.c'
- '**.cc'
- '**.cxx'
- '**.hh'
- '**.hpp'
- '**.hxx'
- '**.inl'
- "**meson.build"
- "flake.nix"
- '.github/workflows/build-linux.yml'
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- 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
ccache -M 5G || true
- name: Restore ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }}
- name: Restore meson cache
uses: actions/cache@v4
with:
path: ~/.cache/meson
key: ${{ runner.os }}-meson-${{ hashFiles('**/meson.build') }}
- 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"
meson compile -C build -j $(nproc)
- name: Install patchelf
run: sudo apt-get install -y patchelf
- name: Package artifact
run: |
cd build
zip -r ../minecraft-client-linux.zip Minecraft.Client --exclude "Minecraft.Client/Minecraft.Client.p/*"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: minecraft-client-linux-${{ github.sha }}
path: minecraft-client-linux.zip
retention-days: 7
- name: Create nightly release
uses: softprops/action-gh-release@v2
with:
tag_name: nightly
name: Nightly
prerelease: true
files: minecraft-client-linux.zip