From 74db0074036737ba33e2018a171f7f41fb4dda2b Mon Sep 17 00:00:00 2001 From: /home/neo <158327205+neoapps-dev@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:13:30 +0300 Subject: [PATCH] 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 --- .github/workflows/release-linux.yml | 87 +++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/release-linux.yml diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml new file mode 100644 index 000000000..a44c987e6 --- /dev/null +++ b/.github/workflows/release-linux.yml @@ -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