Add sokol build in CI #6
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: build | |
on: [push, pull_request] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.13.0 | |
- name: install-dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libglu1-mesa-dev mesa-common-dev xorg-dev libasound-dev libsdl2-dev | |
- name: build-native-SDL2 | |
run: zig build --summary all | |
- name: build-native-sokol | |
run: zig build -Dplatform=sokol --summary all | |
- name: build-web | |
run: zig build --summary all -Dtarget=wasm32-emscripten | |
build-macos: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.13.0 | |
- name: install-dependencies | |
run: | | |
brew install sdl2 | |
- name: build-native-SDL2 | |
run: zig build --summary all | |
- name: build-native-sokol | |
run: zig build -Dplatform=sokol --summary all | |
- name: build-web | |
run: zig build --summary all -Dtarget=wasm32-emscripten | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
target: [ | |
x86_64-windows-msvc, | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.13.0 | |
- name: Install VisualStudio (x64) | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
uwp: false | |
arch: x64 | |
- name: Download SDL2 (Visual Studio) | |
uses: carlosperate/download-file-action@v1.0.3 | |
with: | |
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip | |
file-name: SDL2.tar.gz | |
location: . | |
- name: Extract SDL2 | |
uses: brunoborges/justextract@v1 | |
with: | |
file: SDL2.tar.gz | |
- name: Create SDK file | |
uses: DamianReeves/write-file-action@v1.2 | |
with: | |
path: .build_config/sdl.json | |
contents: | | |
{ | |
"x86_64-windows-msvc": { | |
"include": "SDL2-2.0.18/include", | |
"libs": "SDL2-2.0.18/lib/x64", | |
"bin": "SDL2-2.0.18/lib/x64" | |
} | |
} | |
write-mode: overwrite | |
- name: build-native-SDL2 | |
run: zig build -Dtarget=${{matrix.target}} --summary all | |
- name: build-native-sokol | |
run: zig build -Dtarget=${{matrix.target}} -Dplatform=sokol --summary all | |
- name: build-web | |
run: zig build --summary all -Dtarget=wasm32-emscripten |