From d951f8d9c8371fa1c123815679a9182ed4fcd523 Mon Sep 17 00:00:00 2001 From: Daniel Dada Date: Mon, 15 Dec 2025 12:03:13 +0300 Subject: [PATCH] ci: merged windows and linux builds --- .github/workflows/Test NSIS.yml | 6 +-- .github/workflows/publish-release.yml | 77 +++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-release.yml diff --git a/.github/workflows/Test NSIS.yml b/.github/workflows/Test NSIS.yml index e35dd13..abee7f1 100644 --- a/.github/workflows/Test NSIS.yml +++ b/.github/workflows/Test NSIS.yml @@ -1,9 +1,9 @@ name: Build NSIS Installer on: - push: - branches: [ "master" ] - pull_request: + # push: + # branches: [ "master" ] + # pull_request: jobs: build-windows: diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..32417ce --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,77 @@ +name: Build Packages and Publish Release + +on: + push: + branches: [ "master" ] + pull_request: + branches: + - master + +jobs: + build-packages: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, fedora-latest] + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup Windows Build + if: matrix.os == 'windows-latest' + run: choco install nsis --no-progress -y + + - name: Setup MSVC + if: matrix.os == 'windows-latest' + uses: microsoft/setup-msbuild@v2 + + - name: Install Ubuntu dependencies + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y cmake build-essential git \ + libglfw3-dev libfreetype6-dev libfontconfig1-dev \ + libx11-dev libxrandr-dev libxi-dev \ + mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev \ + libxinerama-dev libxcursor-dev libxkbcommon-dev + + - name: Install Fedora dependencies + if: matrix.os == 'fedora-latest' + run: | + dnf install -y cmake gcc gcc-c++ make rpm-build git \ + glfw-devel freetype-devel fontconfig-devel \ + libX11-devel libXrandr-devel libXi-devel \ + mesa-libGL-devel mesa-libGLU-devel \ + libXinerama-devel libXcursor-devel \ + wayland-devel wayland-protocols-devel + + - name: Configure CMake + run: | + cmake -B build -S . ${{ matrix.os == 'windows-latest' && '-A x64' || '-DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GLFW=ON' }} + + - name: Build project + run: cmake --build build --config Release + + - name: Package NSIS + if: matrix.os == 'windows-latest' + run: | + cd build + cpack -G NSIS + + - name: Package DEB + if: matrix.os == 'ubuntu-latest' + run: | + cd build + cpack -G DEB + + - name: Package RPM + if: matrix.os == 'fedora-latest' + run: | + cd build + cpack -G RPM + + - name: Upload artifacts + uses: actions/upload-artifact@v6 + with: + name: ${{ matrix.os }}-package + path: build/*.{exe,deb,rpm}