-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 2.42 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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: prepare-linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libglu1-mesa-dev mesa-common-dev xorg-dev libasound-dev libsdl2-dev
- name: build-native
run: zig build --summary all
- name: build-web
run: zig build --summary all -Dtarget=wasm32-emscripten
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
- name: prepare-macOS
if: runner.os == 'macOS'
run: |
brew install sdl2
- name: build-native
run: zig build --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)
if: ${{ matrix.target == 'x86_64-windows-msvc' }}
uses: ilammy/msvc-dev-cmd@v1
with:
uwp: false
arch: x64
- name: Download SDL2 (Visual Studio)
uses: carlosperate/download-file-action@v1.0.3
if: ${{ matrix.target == 'x86-windows-msvc' || matrix.target == 'x86_64-windows-msvc' }}
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
run: zig build --summary all
- name: build-web
run: zig build --summary all -Dtarget=wasm32-emscripten