-
Notifications
You must be signed in to change notification settings - Fork 32
269 lines (236 loc) · 7.98 KB
/
meson.yml
File metadata and controls
269 lines (236 loc) · 7.98 KB
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
name: Meson Build (Linux, macOS)
on:
# Triggers the workflow when manually dispatched
workflow_dispatch:
inputs:
upload_artefacts:
description: "Upload build artefacts"
type: boolean
required: false
default: false
build_type:
description: "Build Configuration"
type: choice
required: false
default: "release"
options:
- "release"
- "debug"
debug_level:
description: "Debug Level"
type: choice
required: false
default: "release"
options:
- "release"
- "minimal"
- "full"
new_release_version:
type: string
required: false
osx-version:
type: string
required: false
default: "11.1"
macosx-deployment-target:
type: string
required: false
default: "11.1"
# Triggers the workflow when called by a top-level workflow
workflow_call:
inputs:
upload_artefacts:
type: boolean
required: false
default: false
build_type: # "release" | "debug"
type: string
required: false
default: "release"
debug_level: # "full" | "minimal" | "release"
type: string
required: false
default: "release"
new_release_version:
type: string
required: false
osx-version:
type: string
required: false
default: "11.1"
macosx-deployment-target:
type: string
required: false
default: "11.1"
jobs:
build-linux:
runs-on: ubuntu-latest
name: Linux Build
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Dependencies
run: |
sudo apt-get update -yq
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev libtbb-dev libsdl2-dev libsdl2-image-dev libopengl-dev libfuse2 ninja-build ccache
sudo pip install meson
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ github.job }}-${{ matrix.os }}
- name: Set Version
if: ${{inputs.new_release_version}}
uses: ./.github/actions/set_version
with:
new_release_version: ${{inputs.new_release_version}}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Meson
env:
CC: "ccache gcc"
CXX: "ccache g++"
run: |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false -Db_pch=false build
- name: Configure for AppImage
if: ${{inputs.upload_artefacts}}
env:
CC: "ccache gcc"
CXX: "ccache g++"
run: meson configure -Db_lto=true -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build
- name: Build
env:
CC: "ccache gcc"
CXX: "ccache g++"
run: |
meson compile -C build
- name: Create AppDir
if: ${{inputs.upload_artefacts}}
run: |
echo "Setting output prefix"
DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build"
- name: Download linuxdeploy
if: ${{inputs.upload_artefacts}}
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy
chmod +x lindeploy
- name: Create AppImage
if: ${{inputs.upload_artefacts}}
working-directory: ${{env.GITHUB_WORKSPACE}}
env:
LD_LIBRARY_PATH: ./external/lib/linux/x86_64/
OUTPUT: CortexCommand.AppImage
run: |
echo ${LD_LIBRARY_PATH}
./lindeploy --appdir=build/AppDir --output appimage
- name: Upload Appimage
if: ${{inputs.upload_artefacts}}
uses: actions/upload-artifact@v4
with:
name: CortexCommand (Linux)
path: CortexCommand.AppImage
if-no-files-found: error
build-macos:
runs-on: ubuntu-latest
name: MacOS Build
env:
MACOSX_DEPLOYMENT_TARGET: ${{inputs.macosx-deployment-target}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: "Install Osxcross"
id: osxcross
uses: ./.github/actions/osxcross
with:
osx-version: ${{ inputs.osx-version }}
- name: "Cache Dependencies"
uses: actions/cache@v4
with:
key: ${{runner.os}}-${{inputs.osx-version}}-macports
path: ${{env.OSXCROSS_FOLDER}}/target/macports
- name: "Install Dependencies"
env:
OSXCROSS_MACPORTS_MIRROR: "https://packages.macports.org"
run: |
echo "::group::Installing pkg-config"
sudo apt install pkg-config
echo "::group::Installing mac deps"
omp install SDL3 onetbb lz4 libpng minizip luajit flac
echo "OSXCROSS_PKG_CONFIG_PATH=${{env.OSXCROSS_TARGET}}/macports/pkgs/opt/local/libexec/onetbb/lib/pkgconfig" >> $GITHUB_ENV
echo "::endgroup::"
echo "::group::Installing meson"
pip install meson ninja
echo "::endgroup::"
- name: Set Version
if: ${{inputs.new_release_version}}
uses: ./.github/actions/set_version
with:
new_release_version: ${{inputs.new_release_version}}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ github.job }}-${{ matrix.os }}
- name: Setup Meson
env:
LDFLAGS: "-static-libgcc -static-libstdc++"
run: |
meson setup --cross-file=${{steps.osxcross.outputs.meson-osxcross}} --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false -Db_pch=false build
- name: Configure for App Bundle
if: ${{inputs.upload_artefacts}}
env:
LDFLAGS: "-static-libgcc -static-libstdc++"
run: |
meson configure \
-Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=Contents/Frameworks \
--bindir=Contents/MacOS \
--prefix="/" \
-Ddylibbundler_args="-ns -s ${{env.OSXCROSS_TARGET}}/macports/pkgs/opt/local/lib/ \
-s ${{env.OSXCROSS_TARGET}}/macports/pkgs/opt/local/libexec/onetbb/lib/" \
build
- name: Build
env:
LDFLAGS: "-static-libgcc -static-libstdc++"
run: |
meson compile -C build
- name: Create App Bundle
if: ${{inputs.upload_artefacts}}
run: |
meson install --destdir="/tmp/Cortex Command.app" -C build
- name: Tar files
if: ${{inputs.upload_artefacts}}
run: |
cd /tmp/
tar -cvf CortexCommand.tar "Cortex Command.app"
- name: Move artefact
if: ${{inputs.upload_artefacts}}
run: cp /tmp/CortexCommand.tar .
- name: Artifact Deploy
if: ${{inputs.upload_artefacts}}
uses: actions/upload-artifact@v4
with:
name: CortexCommand (macOS)
path: |
CortexCommand.tar
if-no-files-found: error
build-windows:
runs-on: windows-latest
name: Windows Build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Dependencies
run: |
pip install meson
- name: Setup
run: |
meson setup -Db_pch=false --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} --vsenv build
- name: Build
run: |
meson compile -Cbuild