-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (49 loc) · 1.48 KB
/
cmake.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
name: CMake
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest,windows-latest]
steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: |
mkdir build
if [ ${{matrix.os}} == 'ubuntu-latest' ]; then
sudo apt-get update -y
sudo apt-get install -y \
libsfml-dev \
libxrandr-dev \
libxcursor-dev \
libudev-dev \
libfreetype-dev \
libopenal-dev \
libflac-dev \
libvorbis-dev \
libgl1-mesa-dev \
libegl1-mesa-dev
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSNAKE_GENERATE_INSTALLER=TRUE
elif [ ${{matrix.os}} == 'windows-latest' ]; then
cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSNAKE_GENERATE_INSTALLER=TRUE
fi
shell: bash
- name: Build Program
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Build Installer
working-directory: ${{github.workspace}}/build
run: |
if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then
sudo cpack -G "TGZ"
elif [ ${{ matrix.os }} == 'windows-latest' ]; then
choco install nsis
cpack -G "NSIS;ZIP"
fi
shell: bash