From 698b9fcbf63c4b1efef991534e078990441d6920 Mon Sep 17 00:00:00 2001 From: Tater Date: Tue, 21 Jan 2025 22:11:24 -0600 Subject: [PATCH] Create fast-build.yml --- .github/workflows/fast-build.yml | 107 +++++++++++++++++++++++++++++++ CMakeLists.txt | 1 + src/game/version.h | 3 + 3 files changed, 111 insertions(+) create mode 100644 .github/workflows/fast-build.yml diff --git a/.github/workflows/fast-build.yml b/.github/workflows/fast-build.yml new file mode 100644 index 00000000000..f530ffbfd1f --- /dev/null +++ b/.github/workflows/fast-build.yml @@ -0,0 +1,107 @@ +name: Fast-Build + +on: + push: + branches-ignore: + - gh-readonly-queue/** + +jobs: + build-cmake: + runs-on: ${{ matrix.os }} + env: + CARGO_HTTP_MULTIPLEXING: false + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + include: + - os: ubuntu-latest + cmake-args: -G Ninja -DCMAKE_BUILD_TYPE=Release -DDISCORD=ON -DDISCORD_DYNAMIC=ON -DWEBSOCKETS=OFF -DPREFER_BUNDLED_LIBS=ON + cmake-init-env: CXXFLAGS=-Werror + package-file: "*-linux_x86_64.tar.xz" + fancy: true + - os: macOS-latest + cmake-args: -G Ninja -DCMAKE_BUILD_TYPE=Release -DDISCORD=ON -DWEBSOCKETS=OFF -DPREFER_BUNDLED_LIBS=ON + cmake-init-env: CXXFLAGS=-Werror + package-file: "*-macos.dmg" + fancy: false + - os: windows-latest + cmake-args: -A x64 -DDISCORD=ON + cmake-init-env: CXXFLAGS=/WX LDFLAGS=/WX + package-file: "*-win64.zip" + fancy: false + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Prepare Linux + if: contains(matrix.os, 'ubuntu') + run: | + sudo apt-get update -y + # mount: /var/lib/grub/esp: special device /dev/disk/by-id/scsi-... does not exist. + # sudo apt-get upgrade -y + sudo apt-get install pkg-config cmake ninja-build libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev libvulkan-dev glslang-tools spirv-tools libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev libx264-dev libpng-dev valgrind gcovr libglew-dev -y + + - name: Prepare Linux (fancy) + if: contains(matrix.os, 'ubuntu') && matrix.fancy + run: | + sudo apt-get install libmariadb-dev libwebsockets-dev mariadb-server -y + sudo systemctl stop mysql + sudo rm -rf /var/lib/mysql/ + sudo mysql_install_db --user=mysql --datadir=/var/lib/mysql/ + cd /usr; sudo mysqld_safe --datadir='/var/lib/mysql/' --no-watch + sleep 10 + sudo mysql <> $GITHUB_PATH + sudo rm -rf /Library/Developer/CommandLineTools + + - name: Set Version + shell: bash + run: | + printf '%s' "${{ secrets.VERSION }}" > versioninfo.h + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + + - name: Build in release mode + env: + FLAGS_UNIX: ${{ secrets.FLAGS_UNIX }} + FLAGS_MSVC: ${{ secrets.FLAGS_MSVC }} + shell: bash + run: | + if [[ "${{ matrix.os }}" == "windows-latest" ]]; then + FLAGS="$FLAGS_MSVC" + else + FLAGS="$FLAGS_UNIX" + fi + mkdir release + cd release + ${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} CXXFLAGS="-include $GITHUB_WORKSPACE/versioninfo.h" ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -Werror=dev -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. .. + ${{ matrix.cmake-path }}cmake --build . --config Release --target everything ${{ matrix.build-args }} + + - name: Package + run: | + cd release + ${{ matrix.cmake-path }}cmake --build . --config Release --target package_default ${{ matrix.build-args }} + mkdir artifacts + mv ${{ matrix.package-file }} artifacts + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: ddnet-${{ matrix.os }} + path: release/artifacts \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 436a09c6187..856c5058d75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1839,6 +1839,7 @@ set(EXPECTED_DATA skins7/xmas_hat.png strong_weak.png tclient/fonts/Cabin-Regular.ttf + tclient/fonts/FreeSansBold.ttf tclient/fonts/GoogleSans-Regular.ttf tclient/fonts/Inter_24pt-Regular.ttf tclient/fonts/Inter_24pt-SemiBold.ttf diff --git a/src/game/version.h b/src/game/version.h index 973c6958fcd..972b2b0a4ef 100644 --- a/src/game/version.h +++ b/src/game/version.h @@ -17,5 +17,8 @@ extern const char *GIT_SHORTREV_HASH; #define GAME_NAME "DDNet" #define CLIENT_NAME "TClient" +#ifndef TCLIENT_VERSION #define TCLIENT_VERSION "10.0.4" #endif + +#endif