forked from input-leap/input-leap
-
Notifications
You must be signed in to change notification settings - Fork 0
357 lines (314 loc) · 11.5 KB
/
builds.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
name: Build tests
on:
release:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
build_release:
description: 'Build Release binaries'
required: false
type: boolean
# Set the build type here
env:
B_BUILD_TYPE: ${{ (inputs.build_release || github.event_name == 'release') && 'Release' || 'Debug' }}
DEBIAN_FRONTEND: noninteractive
jobs:
linux-build:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
container: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-20-04
os: "ubuntu:20.04"
cc: "gcc"
cxx: "g++"
wayland: false
- name: ubuntu-22-04-clang
os: "ubuntu:22.04"
cc: "clang"
cxx: "clang++"
wayland: true
- name: ubuntu-22-04
os: "ubuntu:22.04"
cc: "gcc"
cxx: "g++"
wayland: true
steps:
# Preparation steps
- name: Update image and install pre-reqs
run: |
apt-get update -y
apt-get dist-upgrade -y
apt-get install -y \
cmake \
g++ \
clang \
git \
libavahi-compat-libdnssd-dev \
libcurl4-openssl-dev \
libice-dev \
libsm-dev \
libssl-dev \
libxinerama-dev \
libxrandr-dev \
libxtst-dev \
libxkbcommon-dev \
libglib2.0-dev \
ninja-build \
qtdeclarative5-dev \
qttools5-dev
- if: matrix.wayland
name: Install libei and libportal pre-reqs
run: |
apt-get install -y \
ca-certificates \
dbus \
gettext \
git \
libgirepository1.0-dev \
libglib2.0 \
libgtk-3-dev \
libprotobuf-c-dev \
libsystemd-dev \
meson \
protobuf-c-compiler \
protobuf-compiler \
python3-attr \
python3-dbusmock \
python3-jinja2 \
python3-pip \
python3-pytest \
python3-jinja2 \
valac
# Code checkout steps
- name: Checkout input-leap
uses: actions/checkout@v4
with:
path: input-leap
submodules: recursive
set-safe-directory: ${{ github.workspace }}
- name: Get libei v1.2.1 from freedesktop
# Manual checkout of libinput/libei ref 1.2.1 from https://gitlab.freedesktop.org
# because actions/checkout does not support gitlab
if: matrix.wayland
run: |
git clone --depth=1 --branch="$ref" --recurse-submodules -- \
"https://gitlab.freedesktop.org/libinput/libei" libei
env:
ref: 1.2.1
- name: Get libportal from upstream
uses: actions/checkout@v4
if: matrix.wayland
with:
repository: flatpak/libportal
ref: main
path: libportal
- if: matrix.wayland
name: build libei from git tag
run: |
meson setup -Dprefix=/usr -Dtests=disabled -Dliboeffis=disabled -Ddocumentation=[] libei _libei_builddir
ninja -C _libei_builddir install
- if: matrix.wayland
name: build libportal
run: |
meson setup --prefix=/usr -Dbackend-gtk3=enabled -Ddocs=false libportal _libportal_builddir
ninja -C _libportal_builddir install
- name: Configure the build
run: |
cmake -DCMAKE_BUILD_TYPE="${B_BUILD_TYPE}" -S input-leap -B build \
-DCMAKE_CXX_FLAGS:STRING="-Wall -Wextra -Wno-unused-parameter" \
-DCMAKE_CXX_FLAGS_DEBUG:STRING="-g -Werror" \
-DINPUTLEAP_BUILD_LIBEI:BOOL=${{ matrix.wayland }} \
-DCMAKE_INSTALL_PREFIX=input-leap-${{ matrix.name }}
env:
VERBOSE: 1
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- name: Run the build
run: |
cmake --build build --parallel --target install
env:
VERBOSE: 1
# Finally, test step!
- name: Run the tests
run: |
ctest --test-dir build --verbose
- name: Create Artifacts
run: tar -cf input-leap-${{matrix.name}}.tar.gz input-leap-${{matrix.name}}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: input-leap-${{matrix.name}}
path: input-leap-${{matrix.name}}.tar.gz
if-no-files-found: error
mac-build:
name: ${{ matrix.name}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS-x86_64
os: macos-11
qt-version: 5.15
min-macOS-version: 10.9
arch: 'x86_64'
- name: macOS-Universal
os: macos-12
qt-version: 6.6
min-macOS-version: 11
qt-modules: qt5compat
arch: 'arm64;x86_64'
- name: macOS-Apple_Silicon
os: macos-14
qt-version: 6.6
min-macOS-version: 14
qt-modules: qt5compat
arch: 'arm64'
env:
VERBOSE: 1
TERM: xterm-256color
OpenSSL_Install_Path: "/Users/runner/openssl"
OpenSSL_Version: 3.2.0
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{matrix.qt-version}}
modules: ${{matrix.qt-modules}}
cache: true
cache-key-prefix: macOS-${{matrix.os}}-Qt${{matrix.qt-version}}
- name: Setup the image
run: |
brew install ninja
- name: Cache OpenSSL Universal
id: cache-openssl
if: matrix.os == 'macos-12'
uses: actions/[email protected]
with:
path: ${{env.OpenSSL_Install_Path}}
key: macOS-${{matrix.os}}-ssl-${{matrix.arch}}-${{env.OpenSSL_Version}}
- name: Build OpenSSL Universal
if: ((steps.cache-openssl.outputs.cache-hit != 'true') && (matrix.os == 'macos-12'))
run: |
wget https://github.com/openssl/openssl/releases/download/openssl-${{env.OpenSSL_Version}}/openssl-${{env.OpenSSL_Version}}.tar.gz
tar -xf openssl-${{env.OpenSSL_Version}}.tar.gz
echo "#!/bin/bash
if [[ \$* == *-arch\ x86_64* ]] && ! [[ \$* == *-arch\ arm64* ]]; then
cc -arch arm64 \$@
else
cc \$@
fi" >> /Users/runner/cc_override
chmod a+x /Users/runner/cc_override
cat /Users/runner/cc_override
export MACOSX_DEPLOYMENT_TARGET=${{matrix.min-macOS-version}}
export CC=/Users/runner/cc_override
cd openssl-${{env.OpenSSL_Version}}
./configure no-asm darwin64-x86_64-cc --prefix=${{env.OpenSSL_Install_Path}}
make
make install
- uses: actions/checkout@v4
with:
path: input-leap
submodules: recursive
- name: Setup the build
run: |
cmake -DCMAKE_BUILD_TYPE="${B_BUILD_TYPE}" -S input-leap -B build -G Ninja -DOpenSSL_ROOT=${{env.OpenSSL_Install_Path}} \
-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{matrix.min-macOS-version}} -DCMAKE_UNITY_BUILD=1 -DQT_DEFAULT_MAJOR_VERSION=$(echo ${{matrix.qt-version}} | cut -c -1) \
-DCMAKE_OSX_ARCHITECTURES="${{matrix.arch}}"
- name: Run the build
run: |
cmake --build build --parallel
- uses: actions/upload-artifact@v4
if: env.B_BUILD_TYPE == 'Release'
with:
name: ${{ matrix.os }}-installer
path: ./build/bundle/*.dmg
if-no-files-found: error
- name: Archive debug app
if: env.B_BUILD_TYPE != 'Release'
run: tar -czf InputLeap-${{matrix.name}}.tar.gz -C build/bundle InputLeap.app
- uses: actions/upload-artifact@v4
if: env.B_BUILD_TYPE != 'Release'
with:
name: ${{ matrix.name }}-debug
path: ./InputLeap*.tar.gz
if-no-files-found: error
win-build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows Qt5
os: windows-2019
qt-version: 5.15
qt-major: 5
- name: Windows Qt6
os: windows-2022
qt-version: 6.6
qt-major: 6
qt-modules: qt5compat
steps:
- uses: actions/checkout@v4
with:
path: input-leap
submodules: recursive
- name: Download Bonjour SDK-like
id: bonjour
run: |
$ErrorActionPreference = "Stop"
New-Item -Force -ItemType Directory -Path .\deps
Invoke-WebRequest 'https://github.com/nelsonjchen/mDNSResponder/releases/download/v2019.05.08.1/x64_RelWithDebInfo.zip' -OutFile 'deps\BonjourSDKLike.zip' ;
Expand-Archive .\deps\BonjourSDKLike.zip -DestinationPath .\deps\BonjourSDKLike
Remove-Item deps\BonjourSDKLike.zip
"path=$env:GITHUB_WORKSPACE\deps\BonjourSDKLike" >> $env:GITHUB_OUTPUT
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{matrix.qt-version}}
modules: ${{matrix.qt-modules}}
cache: true
cache-key-prefix: windows-${{matrix.os}}-Qt${{matrix.qt-version}}
- name: Configure build system
# NB. use cmd here to set variables from VsDevCmd.bat
shell: cmd
run: |
call "%VS_PATH%\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64
cmake -S input-leap -B build -G "%CMAKE_GEN%" -A x64 -D CMAKE_BUILD_TYPE=%B_BUILD_TYPE% ^
-DQT_DEFAULT_MAJOR_VERSION=${{matrix.qt-major}} ^
-DDNSSD_LIB="%BONJOUR_SDK_HOME%\Lib\x64\dnssd.lib" -D CMAKE_INSTALL_PREFIX=input-leap-install
env:
VS_PATH: ${{ matrix.os == 'windows-2019' && '%ProgramFiles(x86)%\Microsoft Visual Studio\2019' || '%ProgramFiles%\Microsoft Visual Studio\2022' }}
CMAKE_GEN: ${{ matrix.os == 'windows-2019' && 'Visual Studio 16 2019' || 'Visual Studio 17 2022' }}
BONJOUR_SDK_HOME: ${{ steps.bonjour.outputs.path }}
- name: Run build system
run: |
cmake --build build --config $env:B_BUILD_TYPE --target install
- name: Create Archive
run: Compress-Archive -Path input-leap-install\* -DestinationPath ${{ env.B_BUILD_TYPE }}.zip
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ env.B_BUILD_TYPE }}
path: ${{ env.B_BUILD_TYPE }}.zip
if-no-files-found: warn
# Only build & upload installer for release builds on windows-2022
- name: Build the Installer
if: matrix.os == 'windows-2022' && env.B_BUILD_TYPE == 'Release'
run: |
& "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" /Qp .\build\installer-inno\input-leap.iss
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-2022' && env.B_BUILD_TYPE == 'Release'
with:
name: windows-installer
path: .\build\installer-inno\bin
if-no-files-found: error