-
-
Notifications
You must be signed in to change notification settings - Fork 13
72 lines (64 loc) · 2.13 KB
/
build.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
name: Build app
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
linux:
name: Build on Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install cmake
uses: lukka/[email protected]
- name: Install dependencies
run: sudo apt install libsdl2-dev
- name: Build
run: mkdir -p build && cd build && cmake ../ && cmake --build . && cpack
windows:
name: Build on Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install cmake
uses: lukka/[email protected]
- name: Install MinGW
uses: egor-tensin/setup-mingw@v2
- name: Install MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install wget
run: choco install wget
- name: Install dependencies`
run: |
wget -nv https://github.com/libsdl-org/SDL/releases/download/release-2.26.3/SDL2-devel-2.26.3-mingw.zip
7z x -bd SDL2-devel-2.26.3-mingw.zip -omingw
wget -nv https://github.com/libsdl-org/SDL/releases/download/release-2.26.3/SDL2-devel-2.26.3-VC.zip
7z x -bd SDL2-devel-2.26.3-VC.zip -omsvc
- name: Build with MSVC
run: |
mkdir buildMSVC
cd buildMSVC
cmake -G "Visual Studio 17" -DSDL2_DIR=${{ github.workspace }}\msvc\SDL2-2.26.3\cmake -DSDL2_RUNTIME_DIR=${{ github.workspace }}\msvc\SDL2-2.26.3\lib\x64 ..\
cmake --build .
cd ..
- name: Build with MinGW
run: |
mkdir buildMinGW
cd buildMinGW
cmake -G "MinGW Makefiles" -DSDL2_DIR=${{ github.workspace }}\mingw\SDL2-2.26.3\cmake -DSDL2_RUNTIME_DIR=${{ github.workspace }}\mingw\SDL2-2.26.3\x86_64-mingw32\bin -DCMAKE_BUILD_TYPE=Release ..\
cmake --build .
macOS:
name: Build on MacOS
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install cmake
uses: lukka/[email protected]
- name: Install dependencies`
run: brew install sdl2
- name: Build
run: mkdir build && cd build && cmake ../ && cmake --build . && sudo cpack