diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..d7cf9a74 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +name: Build (Release + Cross) + +on: + push: + branches: [ "master" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + # 1) Native Linux build + - os: ubuntu-latest + name: "Linux (Release)" + target: "release" + + # 2) Windows build (cross-compile from Ubuntu with mingw) + - os: ubuntu-latest + name: "Windows (Cross)" + target: "crosswin" + + # 3) Native macOS build + - os: macos-latest + name: "macOS (Release)" + target: "release" + + steps: + - name: Check Out Code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install Meson and Ninja + run: | + python -m pip install --upgrade pip + pip install meson ninja + + - name: Install Dependencies for Cross (mingw) + if: ${{ matrix.target == 'crosswin' }} + run: | + sudo apt-get update + sudo apt-get install -y mingw-w64 + # Add any other packages needed for cross compilation + + - name: Build + run: make ${{ matrix.target }} + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.name }}-artifacts + # If your build output folders differ, adjust accordingly: + path: | + build_release + build_win