From 2c8b9c2dc0097ca9b5dc0f593690bac614297ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 1 Oct 2026 23:33:01 -0300 Subject: [PATCH] Build a eepp-dev-linux-x86_64 package (this will contain all build objects and binaries, allowing to just downloading this and make changes directly without having to recompile the whole thing). --- .github/workflows/eepp-linux-build-check.yml | 38 ++++++++++++++++--- projects/linux/scripts/install_sdl2.sh | 39 ++++++++++++++++---- 2 files changed, 65 insertions(+), 12 deletions(-) diff --git a/.github/workflows/eepp-linux-build-check.yml b/.github/workflows/eepp-linux-build-check.yml index ef0e1da06..331c43542 100644 --- a/.github/workflows/eepp-linux-build-check.yml +++ b/.github/workflows/eepp-linux-build-check.yml @@ -22,7 +22,8 @@ jobs: sudo add-apt-repository -y universe sudo add-apt-repository -y multiverse sudo apt update - sudo apt install -y gcc-13 g++-13 wget libsdl2-2.0-0 libsdl2-dev mesa-utils xvfb gdb + sudo apt install -y gcc-13 g++-13 wget mesa-utils xvfb gdb zstd + bash projects/linux/scripts/install_sdl2.sh --keep-build wget https://cdn.ensoft.dev/eepp-assets/premake-5.0.0-beta6-linux.tar.gz tar xvzf premake-5.0.0-beta6-linux.tar.gz - name: Build @@ -30,6 +31,33 @@ jobs: ./premake5 --disable-static-build --with-debug-symbols gmake cd make/linux make all -j$(nproc) -e config=release_x86_64 + - name: Package development environment + if: github.event_name == 'push' + run: | + { + echo "commit=${GITHUB_SHA}" + echo "compiler=g++-13" + echo "configuration=release_x86_64" + echo "platform=linux" + echo "arch=x86_64" + echo "sdl2=$(sdl2-config --version)" + } > .eepp-dev-environment + + tar \ + --exclude='.git' \ + --exclude='projects/linux/sdk' \ + --zstd \ + -cf ../eepp-dev-linux-x86_64.tar.zst \ + . + + - name: Upload development environment + if: github.event_name == 'push' + uses: actions/upload-artifact@v4 + with: + name: eepp-dev-linux-x86_64 + path: ../eepp-dev-linux-x86_64.tar.zst + retention-days: 5 + compression-level: 0 - name: Set SDK version id: sdk_version run: | @@ -48,6 +76,10 @@ jobs: with: name: linux-eepp-sdk-x86_64 path: projects/linux/sdk/eepp-sdk-*.tar.gz + - name: Unit Tests + run: | + cd projects/scripts + bash ./run_gdb_tests.sh - name: Publish nightly SDK package if: github.ref == 'refs/heads/develop' uses: softprops/action-gh-release@v3 @@ -70,10 +102,6 @@ jobs: fail_on_unmatched_files: true files: | projects/linux/sdk/eepp-sdk-linux-x86_64-*.tar.gz - - name: Unit Tests - run: | - cd projects/scripts - bash ./run_gdb_tests.sh - name: Upload artifacts if: always() uses: actions/upload-artifact@v4 diff --git a/projects/linux/scripts/install_sdl2.sh b/projects/linux/scripts/install_sdl2.sh index 0024e5ed3..a82065e0d 100644 --- a/projects/linux/scripts/install_sdl2.sh +++ b/projects/linux/scripts/install_sdl2.sh @@ -1,9 +1,26 @@ #!/bin/bash +set -euo pipefail # Define SDL version and download URL SDL_VERSION="2.32.10" SDL_URL="https://libsdl.org/release/SDL2-${SDL_VERSION}.zip" ARCH="x86_64" # Default architecture for host +KEEP_BUILD=false + +for arg in "$@"; do + case "$arg" in + --aarch64) + ARCH="aarch64" + ;; + --keep-build) + KEEP_BUILD=true + ;; + *) + echo "Unknown option: $arg" >&2 + exit 1 + ;; + esac +done # Function to install dependencies install_dependencies() { @@ -72,14 +89,14 @@ configure_for_aarch64() { } # Parse options -if [ "$1" == "--aarch64" ]; then - ARCH="aarch64" +if [ "$ARCH" == "aarch64" ]; then install_cross_dependencies fi # Create a temporary directory for the SDL2 build -mkdir -p ./sdl2_build -cd ./sdl2_build || exit +BUILD_DIR="$(pwd)/sdl2_build" +mkdir -p "$BUILD_DIR" +cd "$BUILD_DIR" || exit # Install dependencies install_dependencies @@ -112,10 +129,18 @@ echo "Installing SDL2..." sudo make install || exit # Clean up -echo "Cleaning up..." -rm -rf ./sdl2_build - # Update shared library cache sudo ldconfig +# The zip is redundant once the source has been extracted. +rm -f "$BUILD_DIR/SDL2.zip" + +if [ "$KEEP_BUILD" = false ]; then + echo "Cleaning up..." + cd "$BUILD_DIR/.." || exit + rm -rf "$BUILD_DIR" +else + echo "Keeping SDL2 build tree at: $BUILD_DIR" +fi + echo "SDL2 version ${SDL_VERSION} installed successfully for ${ARCH}!"