-
-
Notifications
You must be signed in to change notification settings - Fork 91
224 lines (186 loc) · 6.73 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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: Build
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mac:
timeout-minutes: 60
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- name: Setup
run: brew install sdl2 python glslang ninja ccache pkg-config
- name: ccache
uses: actions/cache@v3
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Build
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=On
cmake --build .
- name: Test
run: |
cd build
ctest -V -E shelltests .
- name: Package
run: |
cd build
cmake --build . --target package
- name: Upload the build artifacts
uses: actions/upload-artifact@v3
with:
name: dmg
path: build/*.dmg
packages:
timeout-minutes: 45
if: github.repository == 'mgerhardy/vengi'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
sudo apt-get update
sudo apt-get install cmake debhelper devscripts build-essential lintian binutils-dev libunwind-dev libfreetype-dev liblua5.4-dev libsdl2-dev wayland-protocols pkg-config python3 ccache python3-dateutil dh-cmake ninja-build
- name: ccache
uses: actions/cache@v3
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Ubuntu
run: |
contrib/installer/linux/changelog.py docs/CHANGELOG.md > debian/changelog
debuild -b -ui -uc -us
mv ../*.deb .
- name: Upload the ubuntu artifacts
uses: actions/upload-artifact@v3
with:
name: debian
path: vengi*.deb
- name: Upload the ubuntu release artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: Roang-zero1/github-upload-release-artifacts-action@master
with:
args: vengi*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
sudo apt-get update
sudo apt-get install appstream libfuse2 binutils-dev libunwind-dev libfreetype-dev liblua5.4-dev libsdl2-dev wayland-protocols pkg-config ninja-build python3 ccache curl
- name: ccache
uses: actions/cache@v3
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Linux
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=On
cmake --build .
cmake --install . --component voxedit --prefix install-voxedit/usr
- name: Test
run: |
cd build
ctest -V .
- name: AppImage
run: |
curl https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20220822-1/linuxdeploy-x86_64.AppImage --output linuxdeploy-x86_64.AppImage --silent -L -f
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --output=appimage --appdir build/install-voxedit
- name: Upload the AppImage artifacts
uses: actions/upload-artifact@v3
with:
name: appimage
path: voxedit*.AppImage
emscripten:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
sudo apt-get update
sudo apt-get install libfreetype-dev liblua5.4-dev libsdl2-dev wayland-protocols pkg-config ninja-build python3 ccache
- uses: mymindstorm/setup-emsdk@v12
with:
version: 3.1.40
- name: ccache
uses: actions/cache@v3
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-emscripten-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-emscripten-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Emscripten
run: |
cmake -H. -Bbuild -GNinja
cmake --build build --target codegen
mkdir -p build/emscripten
cp -r build/generated build/emscripten
emcmake cmake -H. -Bbuild/emscripten -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=On
cmake --build build/emscripten --target voxedit
- name: Upload the build artifacts
uses: actions/upload-artifact@v3
with:
name: emscripten
path: build/emscripten/voxedit
windows:
timeout-minutes: 45
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Test
run: |
cd build
ctest -V -C Release .
- name: Install
run: |
cd build
cmake --install . --component voxedit --prefix voxedit-install
cmake --install . --component voxconvert --prefix voxconvert-install
cpack
- name: Upload the voxedit artifacts
uses: actions/upload-artifact@v3
with:
name: voxedit
path: build/voxedit-install/
- name: Upload the voxconvert artifacts
uses: actions/upload-artifact@v3
with:
name: voxconvert
path: build/voxconvert-install/
- name: Upload the nsis installer artifacts
uses: actions/upload-artifact@v3
with:
name: windows-installer
path: build/vengi-*-Windows.exe