This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
forked from DataRealms/CCOSS
-
Notifications
You must be signed in to change notification settings - Fork 41
202 lines (175 loc) · 5.74 KB
/
meson.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
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"
# 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"
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@v3
- uses: actions/setup-python@v3
- 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
sudo pip install meson
- name: Setup Meson
env:
CC: "gcc"
CXX: "g++"
run: |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=true build
- name: Configure for AppImage
if: ${{inputs.upload_artefacts}}
env:
CC: "gcc"
CXX: "g++"
run: meson configure -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build
- name: Build
env:
CC: "gcc"
CXX: "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@v3
with:
name: CortexCommand (Linux)
path: CortexCommand.AppImage
if-no-files-found: error
build-macos:
runs-on: macos-11
name: MacOS Build
env:
GCC_VERSION: "13"
MACOSX_DEPLOYMENT_TARGET: 10.15
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: "Install Dependencies"
uses: melusina-org/setup-macports@v1
with:
parameters: ".github/parameters/macports.yml"
- name: Setup Meson
env:
CC: "gcc-${{env.GCC_VERSION}}"
CXX: "g++-${{env.GCC_VERSION}}"
LDFLAGS: "-static-libgcc -static-libstdc++"
run: |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false build
- name: Configure for App Bundle
if: ${{inputs.upload_artefacts}}
env:
CC: "gcc-${{env.GCC_VERSION}}"
CXX: "g++-${{env.GCC_VERSION}}"
LDFLAGS: "-static-libgcc -static-libstdc++"
run: |
meson configure \
-Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=Contents/Frameworks \
--bindir=Contents/MacOS \
--prefix="/" \
build
- name: Build
env:
CC: "gcc-${{env.GCC_VERSION}}"
CXX: "g++-${{env.GCC_VERSION}}"
LDFLAGS: "-static-libgcc -static-libstdc++"
run: |
meson compile -C build
- name: Create App Bundle
if: ${{inputs.upload_artefacts}}
run: |
DESTDIR="/tmp/Cortex Command.app" meson install -C build
- name: Tar files
if: ${{inputs.upload_artefacts}}
run: |
tree /tmp/
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@v3
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@v3
- uses: actions/setup-python@v3
- name: Install Dependencies
run: |
pip install meson
- name: Setup
run: |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} --vsenv build
- name: Build
run: |
meson compile -Cbuild