forked from teeworlds/teeworlds
-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (145 loc) · 4.79 KB
/
build.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Build
on: [push, pull_request, merge_group]
jobs:
build-cmake:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest, ubuntu-20.04]
include:
- os: ubuntu-latest
cmake-args: -G Ninja
package-file: "*-linux_x86_64.tar.xz"
env:
CFLAGS: -Wdeclaration-after-statement -Werror
CXXFLAGS: -Werror
- os: ubuntu-20.04
cmake-path: /usr/bin/
cmake-args: -G Ninja
package-file: "*-linux_x86_64.tar.xz"
env:
CFLAGS: -Wdeclaration-after-statement -Werror
CXXFLAGS: -Werror
- os: macOS-latest
cmake-args: -G Ninja
package-file: "*-macos.dmg"
env:
CFLAGS: -Wdeclaration-after-statement -Werror
CXXFLAGS: -Werror
- os: windows-latest
cmake-args: -A x64
package-file: "*-win64.zip"
env:
CFLAGS: /WX
CXXFLAGS: /WX
LDFLAGS: /WX
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare Linux
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update -y
sudo apt-get install pkg-config cmake ninja-build libfreetype6-dev libsdl2-dev -y
- name: Prepare MacOS
if: contains(matrix.os, 'macOS')
run: |
brew update || true
brew install pkg-config sdl2 python3 ninja || true
# --overwrite for: Target /usr/local/bin/2to3 already exists.
brew link --overwrite [email protected]
brew upgrade freetype
sudo rm -rf /Library/Developer/CommandLineTools
- name: Build in debug mode
env: ${{ matrix.env }}
run: |
mkdir debug
cd debug
${{ matrix.cmake-path }}cmake --version
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }} --target everything
- name: Test debug
run: |
cd debug
${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }} --target run_tests
- name: Run debug server
env: ${{ matrix.env }}
run: |
cd debug
./teeworlds_srv shutdown
- name: Build in release mode
env: ${{ matrix.env }}
run: |
mkdir release
cd release
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -Werror=dev -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. ..
${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target everything
- name: Test release
run: |
cd release
${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target run_tests
- name: Run release server
env: ${{ matrix.env }}
run: |
cd release
./teeworlds_srv shutdown
- name: Package
run: |
cd release
${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target package_default
mkdir artifacts
mv ${{ matrix.package-file }} artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: teeworlds-${{ matrix.os }}
path: release/artifacts
build-bam:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Checkout bam
uses: actions/checkout@v2
with:
repository: matricks/bam
ref: 8cd08744c37666830d439ab54016c9d228c63b68
path: ./bam
- name: Prepare Linux
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update -y
sudo apt-get install libfreetype6-dev libsdl2-dev -y
cd bam
./make_unix.sh
- name: Prepare MacOS
if: contains(matrix.os, 'macOS')
run: |
brew update
brew install sdl2
cd bam
./make_unix.sh
- name: Prepare Windows
if: contains(matrix.os, 'windows')
run: |
cd bam
./make_win64_msvc.bat
- name: Build in debug mode
run: ./bam/bam conf=debug all
- name: Test debug
run: ./build/x86_64/debug/teeworlds_srv shutdown
- name: Build in release mode
run: ./bam/bam conf=release all
- name: Test release
run: ./build/x86_64/release/teeworlds_srv shutdown
- name: Create MacOS app using make_release.py
if: contains(matrix.os, 'macOS')
run: |
sudo python3 scripts/make_release.py master macos