-
Notifications
You must be signed in to change notification settings - Fork 131
367 lines (309 loc) · 11.1 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
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
name: Build Binaries
on:
workflow_dispatch:
inputs:
build-debug-info:
description: 'Profile and debug the build process'
required: false
default: false
type: boolean
use-ccache:
description: 'Enable ccache/sccache'
required: false
default: true
type: boolean
pull_request:
push:
branches:
- '**' # every branch
- '!no-build-**' # unless marked as no-build
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
base-configure-command: >-
cmake -B build
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DGEODE_CODEGEN_CMAKE_ARGS="-DCMAKE_C_COMPILER=clang;-DCMAKE_CXX_COMPILER=clang++;-G Ninja"
-G Ninja
base-build-command: |
cmake --build build --config RelWithDebInfo --parallel
rm bin/nightly/resources/.geode_cache
jobs:
build-windows:
name: Build Windows
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare for Build Debug Info
id: build-debug-info
uses: ./.github/actions/build-debug-info
with:
has-sccache: ${{ inputs.use-ccache }}
if: inputs.build-debug-info
- name: Setup caches
uses: ./.github/actions/setup-cache
with:
host: linux
target: win
use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
- name: Setup Ninja
uses: ./.github/actions/setup-ninja
with:
host: linux
- name: Setup CLI
uses: geode-sdk/cli/.github/actions/setup@main
- name: Download xwin
uses: robinraju/release-downloader@v1.10
with:
repository: Jake-Shadle/xwin
latest: true
fileName: 'xwin-*-x86_64-unknown-linux-musl.tar.gz'
tarBall: false
zipBall: false
out-file-path: "epic-xwin"
- name: Prepare xwin
run: |
tar -xzf epic-xwin/xwin-*-x86_64-unknown-linux-musl.tar.gz -C epic-xwin
mv epic-xwin/xwin-*-x86_64-unknown-linux-musl/xwin ./xwin
./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license list
# this caches '.xwin-cache/**/*' but that's actually only gonna
# contain the manifest cuz we only ran `xwin list` so far
- name: Setup xwin Cache
id: xwin-cache
uses: actions/cache@v4
with:
path: .xwin-cache
key: xwin-win-v1-${{ hashFiles('.xwin-cache/**/*') }}
- name: Download Windows headers
run: ./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license splat --include-debug-libs
if: steps.xwin-cache.outputs.cache-hit != 'true'
- name: Download clang-msvc-sdk toolchain
uses: actions/checkout@v4
with:
repository: 'geode-sdk/clang-msvc-sdk'
path: toolchain
submodules: recursive
- name: Configure
run: ${{ env.base-configure-command }} -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN ${{ steps.build-debug-info.outputs.extra-configure }}
env:
SPLAT_DIR: ${{ github.workspace }}/.xwin-cache/splat
TOOLCHAIN: ${{ github.workspace }}/toolchain/clang-msvc.cmake
HOST_ARCH: x86_64
- name: Build
run: |
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: geode-win
path: ./bin/nightly
- name: Package Installer
run: |
sudo apt install nsis
makensis -WX -V3 ./installer/windows/installer.nsi
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: geode-installer-win
path: './installer/windows/geode-installer-win.exe'
- name: Complete Build Debug Info
uses: ./.github/actions/build-debug-info-post
with:
target: win
if: inputs.build-debug-info && (success() || failure())
build-mac:
name: Build macOS
runs-on: macos-latest
env:
SCCACHE_CACHE_MULTIARCH: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare for Build Debug Info
id: build-debug-info
uses: ./.github/actions/build-debug-info
with:
has-sccache: ${{ inputs.use-ccache }}
if: inputs.build-debug-info
# due to very strange performance issues, sccache is currently disabled for macos. sorry
# - name: Setup caches
# uses: ./.github/actions/setup-cache
# with:
# host: mac
# target: mac
# use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
- name: Setup Ninja
uses: ./.github/actions/setup-ninja
with:
host: mac
- name: Setup CLI
uses: geode-sdk/cli/.github/actions/setup@main
- name: Configure
run: >
${{ env.base-configure-command }}
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
-DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF
${{ steps.build-debug-info.outputs.extra-configure }}
- name: Build
run: |
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: geode-mac
path: ./bin/nightly
- name: Package Installer
run: ./installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: geode-installer-mac
path: './installer/mac/geode-installer-mac.pkg'
- name: Complete Build Debug Info
uses: ./.github/actions/build-debug-info-post
with:
target: mac
if: inputs.build-debug-info && (success() || failure())
build-android:
strategy:
fail-fast: false
matrix:
config:
- name: Android (32-bit)
id: android32
extra-configure: -DANDROID_ABI=armeabi-v7a
- name: Android (64-bit)
id: android64
extra-configure: -DANDROID_ABI=arm64-v8a
name: Build ${{ matrix.config.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare for Build Debug Info
id: build-debug-info
uses: ./.github/actions/build-debug-info
with:
has-sccache: ${{ inputs.use-ccache }}
if: inputs.build-debug-info
- name: Setup caches
uses: ./.github/actions/setup-cache
with:
host: linux
target: ${{ matrix.config.id }}
use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
- name: Setup Ninja
uses: ./.github/actions/setup-ninja
with:
host: linux
- name: Setup CLI
uses: geode-sdk/cli/.github/actions/setup@main
- name: Setup Breakpad Tools
uses: ./.github/actions/setup-dump-sym
id: breakpad-tools
- name: Fix Ubuntu libcstd++
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install --only-upgrade libstdc++6
- name: Configure
run: >
${{ env.base-configure-command }}
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DANDROID_PLATFORM=android-23
-DANDROID_STL=c++_shared
${{ matrix.config.extra-configure }}
${{ steps.build-debug-info.outputs.extra-configure }}
- name: Build
run: |
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
# hardcoding toolchain path :(
- name: Dump Symbols
run: |
${{ steps.breakpad-tools.outputs.binary-path }} ./bin/nightly/Geode.${{ matrix.config.id }}.so -o ./bin/nightly/Geode.${{ matrix.config.id }}.so.sym
$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip ./bin/nightly/Geode.${{ matrix.config.id }}.so
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: geode-${{ matrix.config.id }}
path: ./bin/nightly
- name: Complete Build Debug Info
uses: ./.github/actions/build-debug-info-post
with:
target: ${{ matrix.config.id }}
if: inputs.build-debug-info && (success() || failure())
publish:
name: Publish
runs-on: ubuntu-latest
needs: [ build-windows, build-mac, build-android ]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Declare Version Variables
id: ref
run: |
echo "version=$(cat VERSION | xargs)" >> $GITHUB_OUTPUT
echo "hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Move Installers
run: |
mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ steps.ref.outputs.hash }}-win.exe
- name: Zip MacOS Artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-mac/Geode.dylib geode-mac/GeodeBootstrapper.dylib
dest: geode-${{ steps.ref.outputs.hash }}-mac.zip
- name: Zip Windows Artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-win/XInput1_4.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb
dest: geode-${{ steps.ref.outputs.hash }}-win.zip
- name: Zip Android32 Artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-android32/Geode.android32.so geode-android32/Geode.android32.so.sym
dest: geode-${{ steps.ref.outputs.hash }}-android32.zip
- name: Zip Android64 Artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-android64/Geode.android64.so geode-android64/Geode.android64.so.sym
dest: geode-${{ steps.ref.outputs.hash }}-android64.zip
- name: Zip Resources
uses: vimtor/action-zip@v1.2
with:
files: geode-android64/resources
dest: resources.zip
- name: Update Development Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Development Release'
body: |
Geode development release for commit ${{ github.sha }}. Since this is not a regular release, Geode will not install the resources automatically, so you should use the installer if you want them.
files: |
./geode-installer-${{ steps.ref.outputs.hash }}-win.exe
./geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
./geode-${{ steps.ref.outputs.hash }}-win.zip
./geode-${{ steps.ref.outputs.hash }}-mac.zip
./geode-${{ steps.ref.outputs.hash }}-android32.zip
./geode-${{ steps.ref.outputs.hash }}-android64.zip
./resources.zip