forked from natinusala/borealis
-
Notifications
You must be signed in to change notification settings - Fork 23
232 lines (224 loc) · 7.34 KB
/
ci.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
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
225
226
227
228
229
230
231
232
name: Build borealis demo
on:
push:
pull_request:
jobs:
ios:
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: cache
id: cache-key
run: echo "IOS_CACHE_KEY=ios-cmake-build-dir-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake', '.github/workflows/ci.yaml') }}" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v4
id: ios-cache
with:
path: build
key: ${{ steps.cache-key.outputs.IOS_CACHE_KEY }}
- name: Build
run: |
./build_libromfs_generator.sh
cmake -B build -G Xcode -DPLATFORM_IOS=ON -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=13.0
cmake --build build
ditto -ck --rsrc --sequesterRsrc --keepParent build/Debug-iphoneos/borealis_demo.app borealis_demo.zip
- uses: actions/cache/save@v4
if: ${{ !steps.ios-cache.outputs.cache-hit }}
with:
path: build
key: ${{ steps.cache-key.outputs.IOS_CACHE_KEY }}
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-ios
path: borealis_demo.zip
ps4:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
docker run --rm -v $(pwd):/src/ xfangfang/pacbrew:latest \
"cmake -B build -DPLATFORM_PS4=ON \
-DCMAKE_BUILD_TYPE=Release && \
make -C build -j$(nproc)"
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-ps4
path: build/*.pkg
psv:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
docker run --rm -v $(pwd):/src/ xfangfang/vitasdk_sdl2_gles2:latest \
"cmake -B build -G Ninja -DPLATFORM_PSV=ON -DUSE_SYSTEM_SDL2=ON -DCMAKE_BUILD_TYPE=Release && \
cmake --build build"
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-psv
path: build/*.vpk
switch:
runs-on: ubuntu-latest
container:
image: devkitpro/devkita64
strategy:
fail-fast: false
matrix:
driver: [ glfw, sdl2, deko3d ]
include:
- { driver: glfw, cmake: "-DUSE_GLFW=ON", ext: "gl3-glfw" }
- { driver: sdl2, cmake: "-DUSE_SDL2=ON", ext: "gl3-sdl2" }
- { driver: deko3d, cmake: "-DUSE_DEKO3D=ON", ext: "deko3d" }
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DPLATFORM_SWITCH=ON ${{ matrix.cmake }}
make -C build borealis_demo.nro -j$(nproc)
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-switch-${{ matrix.ext }}
path: build/borealis_demo.nro
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: nttld/setup-ndk@v1
id: setup_ndk
with:
ndk-version: r22b
local-cache: true
- name: Setup
run: |
sudo apt-get update
sudo apt-get install ninja-build pkg-config
- name: Build
id: build
run: |
./build_libromfs_generator.sh
cd android-project && ./gradlew assembleDebug
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-android
path: android-project/app/build/outputs/apk/debug/*.apk
macos:
runs-on: macos-14
name: macos (${{ matrix.window.name }})
strategy:
matrix:
window:
- { name: glfw, cmake: "-DUSE_GLFW=ON" }
- { name: sdl2, cmake: "-DUSE_SDL2=ON" }
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DPLATFORM_DESKTOP=ON -DBUNDLE_MACOS_APP=ON ${{ matrix.window.cmake }}
make -C build -j$(sysctl -n hw.ncpu)
mkdir borealis-macos-${{ matrix.window.name }}
mv build/borealis_demo.app borealis-macos-${{ matrix.window.name }}/
tar -czvf borealis-macos-${{ matrix.window.name }}.tar.gz borealis-macos-${{ matrix.window.name }}
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-macos-${{ matrix.window.name }}
path: borealis-macos-${{ matrix.window.name }}.tar.gz
windows:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
driver: [gl, d3d11]
include:
- { driver: d3d11, cmake: "-DUSE_D3D11=ON" }
env:
MSYSTEM: MINGW64
MSYS2_PATH_TYPE: inherit
defaults:
run:
shell: C:\shells\msys2bash.cmd {0}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependency
run: |
pacman -S --needed --noconfirm --noprogressbar \
${MINGW_PACKAGE_PREFIX}-gcc \
${MINGW_PACKAGE_PREFIX}-ninja
- name: Build
run: |
cmake -B build -G Ninja ${{ matrix.cmake }} \
-DCMAKE_BUILD_TYPE=Release \
-DPLATFORM_DESKTOP=ON \
-DWIN32_TERMINAL=OFF \
-DUSE_LIBROMFS=ON \
-DZLIB_USE_STATIC_LIBS=ON
cmake --build build
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-windows-x86_64-${{ matrix.driver }}
path: build/borealis_demo.exe
linux:
name: linux (${{ matrix.driver }}${{ matrix.ext }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { driver: gl2, cmake: "-DUSE_GL2=ON" }
- { driver: gles2, cmake: "-DUSE_GLES2=ON" }
- { driver: gles3, cmake: "-DUSE_GLES3=ON" }
- { driver: gl3, cmake: "-DUSE_GLFW=ON", ext: "-glfw" }
- { driver: gl3, cmake: "-DUSE_SDL2=ON", ext: "-sdl2" }
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install -y libdbus-1-dev libxkbcommon-dev \
libwayland-dev wayland-protocols libx11-dev libxrandr-dev libxinerama-dev \
libxcursor-dev libxi-dev --no-install-recommends
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake }} \
-DPLATFORM_DESKTOP=ON \
-DUSE_LIBROMFS=ON \
-DX11_X11_LIB=ON
make -C build -j$(nproc)
output_dir=borealis-linux-x86_64-${{ matrix.driver }}${{ matrix.ext }}
strip build/borealis_demo
mkdir -p ${output_dir}
mv build/borealis_demo ${output_dir}
tar -czvf ${output_dir}.tar.gz ${output_dir}
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: borealis-linux-x86_64-${{ matrix.driver }}${{ matrix.ext }}
path: borealis-linux-x86_64-${{ matrix.driver }}${{ matrix.ext }}.tar.gz