adapt build system to zig master #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cross Build (windows) | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
concurrency: | |
# Cancels pending runs when a PR gets updated. | |
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} | |
cancel-in-progress: true | |
jobs: | |
build-cross-windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
#host: [ubuntu-latest, macos-latest] | |
host: [ubuntu-latest] | |
runs-on: ${{matrix.host}} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Zig | |
uses: mlugg/setup-zig@v1 | |
with: | |
version: master | |
- name: Download SDL2 (MinGW) | |
uses: carlosperate/[email protected] | |
with: | |
file-url: https://www.libsdl.org/release/SDL2-devel-2.30.9-mingw.tar.gz | |
file-name: SDL2.tar.gz | |
location: . | |
- name: Extract SDL2 | |
uses: brunoborges/justextract@v1 | |
with: | |
file: SDL2.tar.gz | |
- name: Create SDK file | |
uses: DamianReeves/[email protected] | |
with: | |
path: .build_config/sdl.json | |
contents: | | |
{ | |
"x86_64-windows-gnu": { | |
"include": "SDL2-2.30.9/x86_64-w64-mingw32/include", | |
"libs": "SDL2-2.30.9/x86_64-w64-mingw32/lib", | |
"bin": "SDL2-2.30.9/x86_64-w64-mingw32/bin" | |
} | |
} | |
write-mode: overwrite | |
- name: Build examples | |
run: zig build -Dtarget=x86_64-windows-gnu -Dskip=particle_life examples |