1
1
name : Meson Build (Linux, macOS)
2
- # Controls when the action will run.
2
+
3
3
on :
4
- # Triggers the workflow on push or pull request events but only for the development branch
5
- push :
6
- branches : [ master, development ]
7
- release :
4
+ # Triggers the workflow when manually dispatched
8
5
workflow_dispatch :
6
+ inputs :
7
+ upload_artefacts :
8
+ description : " Upload build artefacts"
9
+ type : boolean
10
+ required : false
11
+ default : false
12
+ build_type :
13
+ description : " Build Configuration"
14
+ type : choice
15
+ required : false
16
+ default : " release"
17
+ options :
18
+ - " release"
19
+ - " debug"
20
+ debug_level :
21
+ description : " Debug Level"
22
+ type : choice
23
+ required : false
24
+ default : " release"
25
+ options :
26
+ - " release"
27
+ - " minimal"
28
+ - " full"
29
+
30
+ # Triggers the workflow when called by a top-level workflow
31
+ workflow_call :
32
+ inputs :
33
+ upload_artefacts :
34
+ type : boolean
35
+ required : false
36
+ default : false
37
+ build_type : # "release" | "debug"
38
+ type : string
39
+ required : false
40
+ default : " release"
41
+ debug_level : # "full" | "minimal" | "release"
42
+ type : string
43
+ required : false
44
+ default : " release"
45
+
46
+ env :
47
+ MESON_VERSION : " 0.60.3"
9
48
10
-
11
- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
12
49
jobs :
13
- # This workflow contains a single job called "build"
14
- build-release-linux :
15
- # The type of runner that the job will run on
16
- runs-on : ubuntu-latest
50
+ build-linux :
17
51
52
+ runs-on : ubuntu-latest
53
+ name : Linux Build
18
54
19
- # Steps represent a sequence of tasks that will be executed as part of the job
20
55
steps :
21
56
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22
57
- uses : actions/checkout@v3
@@ -26,36 +61,44 @@ jobs:
26
61
run : |
27
62
sudo apt-get update -yq
28
63
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 libopengl-dev libfuse2 ninja-build
29
- sudo pip install meson==0.60.0
64
+ sudo pip install meson==${{env.MESON_VERSION}}
30
65
31
- - name : Install Clang
32
- # You may pin to the exact commit or the version.
33
- # uses: egor-tensin/setup-clang@d16e36d5f8a7eb00aa6627c1a536d94dfc4a913d
34
- uses : egor-tensin/setup-clang@v1
35
- with :
36
- # Set up cc/c++ executables
37
- cc : 1 # optional, default is 1
66
+ - name : Setup Meson
67
+ env :
68
+ CC : " gcc"
69
+ CXX : " g++"
70
+ run : |
71
+ meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} build
38
72
73
+ - name : Configure for AppImage
74
+ if : ${{inputs.upload_artefacts}}
75
+ env :
76
+ CC : " gcc"
77
+ CXX : " g++"
78
+ run : meson configure -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build
79
+
39
80
- name : Build
40
81
env :
41
82
CC : " gcc"
42
83
CXX : " g++"
43
84
run : |
44
- meson setup --buildtype=release -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build
45
85
meson compile -C build
46
-
86
+
47
87
- name : Create AppDir
88
+ if : ${{inputs.upload_artefacts}}
48
89
run : |
49
90
echo "Setting output prefix"
50
91
DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build"
51
92
52
93
- name : Download linuxdeploy
94
+ if : ${{inputs.upload_artefacts}}
53
95
working-directory : ${{env.GITHUB_WORKSPACE}}
54
96
run : |
55
97
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy
56
98
chmod +x lindeploy
57
99
58
100
- name : Create AppImage
101
+ if : ${{inputs.upload_artefacts}}
59
102
working-directory : ${{env.GITHUB_WORKSPACE}}
60
103
env :
61
104
LD_LIBRARY_PATH : ./external/lib/linux/x86_64/
@@ -65,33 +108,40 @@ jobs:
65
108
./lindeploy --appdir=build/AppDir --output appimage
66
109
67
110
- name : Upload Appimage
111
+ if : ${{inputs.upload_artefacts}}
68
112
uses : actions/upload-artifact@v3
69
113
with :
70
114
name : CortexCommand (Linux)
71
115
path : CortexCommand.AppImage
116
+ if-no-files-found : error
72
117
73
- build-release- macos :
118
+ build-macos :
74
119
runs-on : macos-latest
120
+ name : MacOS Build
75
121
76
122
steps :
77
123
- uses : actions/checkout@v3
78
124
- uses : actions/setup-python@v3
79
125
80
126
- name : Install Dependencies
81
127
run : |
82
- brew install pkg-config tbb sdl2 minizip lz4 flac luajit lua@5.1 libpng gcc ninja meson
83
-
128
+ brew install pkg-config tbb sdl2 minizip lz4 flac luajit lua@5.1 libpng gcc@12 ninja meson
129
+
84
130
- name : Build
85
131
env :
86
132
CC : " gcc-12"
87
133
CXX : " g++-12"
88
134
LDFLAGS : " -static-libgcc -static-libstdc++"
89
135
run : |
90
- meson setup --buildtype=release -Ddebug_type=release build
136
+ meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} build
91
137
meson compile -C build
92
138
93
139
- name : Artifact Deploy
140
+ if : ${{inputs.upload_artefacts}}
94
141
uses : actions/upload-artifact@v3
95
142
with :
96
143
name : CortexCommand (macOS)
97
- path : build/CortexCommand
144
+ path : |
145
+ build/CortexCommand
146
+ build/CortexCommand_debug
147
+ if-no-files-found : error
0 commit comments