forked from input-leap/input-leap
-
Notifications
You must be signed in to change notification settings - Fork 0
519 lines (455 loc) · 16.1 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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
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-22-04-clang
os: "ubuntu:22.04"
cc: "clang"
cxx: "clang++"
wayland: none
- name: ubuntu-22-04
os: "ubuntu:22.04"
cc: "gcc"
cxx: "g++"
wayland: none
- name: ubuntu-24-04
os: "ubuntu:24.04"
cc: "gcc"
cxx: "g++"
wayland: dist
- name: ubuntu-24-10
os: "ubuntu:24.10"
cc: "gcc"
cxx: "g++"
wayland: dist
- name: debian-12
os: "debian:bookworm"
cc: "gcc"
cxx: "g++"
wayland: none
- name: debian-12-latest-libei
os: "debian:bookworm"
cc: "gcc"
cxx: "g++"
wayland: latest
steps:
- name: Update and install packages
run: |
apt-get update -y
apt-get dist-upgrade -y
apt-get install -y \
cmake \
g++ \
clang \
git \
libavahi-compat-libdnssd-dev \
libgtest-dev \
libgl-dev \
libgmock-dev \
libice-dev \
libsm-dev \
libssl-dev \
libxinerama-dev \
libxrandr-dev \
libxtst-dev \
libxkbcommon-dev \
libglib2.0-dev \
ninja-build \
qt6-base-dev \
qt6-l10n-tools \
qt6-tools-dev-tools \
qt6-tools-dev
- if: env.B_BUILD_TYPE == 'Release'
name: Install release installer build packages
run: |
apt-get install -y \
debhelper \
devscripts \
xvfb
- if: matrix.wayland == 'latest'
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
- if: matrix.wayland == 'dist'
name: Install libei and libportal distribution packages
run: |
apt-get install -y \
libei-dev \
libportal-dev
# Code checkout steps
- name: Checkout input-leap
uses: actions/checkout@v4
with:
path: input-leap
submodules: recursive
set-safe-directory: ${{ github.workspace }}
- if: matrix.wayland == 'latest'
name: Get libei v1.3.0 from freedesktop
# Manual checkout of libinput/libei ref 1.3.0 from https://gitlab.freedesktop.org
# because actions/checkout does not support gitlab
run: |
git clone --depth=1 --branch="$ref" --recurse-submodules -- \
"https://gitlab.freedesktop.org/libinput/libei" libei
env:
ref: 1.3.0
- if: matrix.wayland == 'latest'
name: Get libportal from upstream
uses: actions/checkout@v4
with:
repository: flatpak/libportal
ref: main
path: libportal
- if: matrix.wayland == 'latest'
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 == 'latest'
name: build libportal
run: |
meson setup --prefix=/usr -Dbackend-gtk3=enabled -Ddocs=false libportal _libportal_builddir
ninja -C _libportal_builddir install
- name: Run build
if: env.B_BUILD_TYPE != 'Release'
run: |
cmake -DCMAKE_BUILD_TYPE="${B_BUILD_TYPE}" -S input-leap -B build -G Ninja \
-DCMAKE_CXX_FLAGS:STRING="-Wall -Wextra -Wno-unused-parameter" \
-DCMAKE_CXX_FLAGS_DEBUG:STRING="-g -Werror" \
-DCMAKE_UNITY_BUILD=1 \
-DINPUTLEAP_BUILD_LIBEI:BOOL=${{ (matrix.wayland != 'none') && '1' || '0' }} \
-DCMAKE_INSTALL_PREFIX=input-leap-${{ matrix.name }}
cmake --build build --parallel --target install
env:
VERBOSE: 1
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- name: Run the tests
if: env.B_BUILD_TYPE != 'Release'
run: |
ctest --test-dir build --verbose
- name: Create Artifacts
if: env.B_BUILD_TYPE != 'Release'
run: tar -cf input-leap-${{matrix.name}}.tar.gz input-leap-${{matrix.name}}
- name: Upload Artifacts
if: env.B_BUILD_TYPE != 'Release'
uses: actions/upload-artifact@v4
with:
name: input-leap-${{matrix.name}}
path: input-leap-${{matrix.name}}.tar.gz
if-no-files-found: error
- name: Build Debian package
if: env.B_BUILD_TYPE == 'Release'
run: |
cd input-leap
cp -r dist/debian debian
if [ "${{ matrix.wayland }}" = "dist" ]; then
sed -i -e 's/-DINPUTLEAP_BUILD_LIBEI=0/-DINPUTLEAP_BUILD_LIBEI=1/g' debian/rules
fi
debuild -us -uc
- name: Upload Artifacts
if: env.B_BUILD_TYPE == 'Release'
uses: actions/upload-artifact@v4
with:
name: input-leap-deb-${{matrix.name}}
path: input-leap_*.deb
if-no-files-found: error
linux-rpm:
name: ${{ matrix.os }}
runs-on: ubuntu-latest
container: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["fedora:40"]
include:
- installer: dnf install -y
rpm_tag: fedora
steps:
- name: Install extra build dependencies
run: ${{ matrix.installer }} git rpm-build ninja-build
# submodules require git to be installed
- name: Check out repository
uses: actions/checkout@v4
with:
path: input-leap
submodules: recursive
set-safe-directory: ${{ github.workspace }}
- name: Install dependencies
run: |
# Replace foo >= x with "foo >= x", print only what follows ^BuildRequires
sed -n 's/\(\S\+ [<>=]\+ [0-9]\+.\?[0-9]\?\)/"\1"/;{s/^BuildRequires: //p}' input-leap/dist/rpm/input-leap.spec.in | xargs ${{ matrix.installer }}
- name: prep tree
run: |
cmake -S input-leap -GNinja -B build -DCMAKE_UNITY_BUILD=1 -DINPUTLEAP_USE_EXTERNAL_GTEST=True
ninja -C build package_source
- name: create target directory
run: mkdir rpms
- name: build SRPM package
run: |
rpmbuild -D "_sourcedir $PWD/build" -D "_srcrpmdir ${PWD}/rpms" -bs build/rpm/input-leap.spec
- name: build RPM package
run: |
rpmbuild -D "_sourcedir $PWD/build" -D "_rpmdir $PWD/rpms" -bb build/rpm/input-leap.spec
- name: Archive RPM package
uses: actions/upload-artifact@v4
with:
name: input-leap-rpms-${{ matrix.rpm_tag }}
path: |
rpms/**/*.rpm
mac-build:
name: ${{ matrix.name}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS-x86_64
os: macos-12
qt-version: 6.6
min-macOS-version: 10.15
arch: 'x86_64'
- name: macOS-Universal
os: macos-12
qt-version: 6.6
min-macOS-version: 11
arch: 'arm64;x86_64'
- name: macOS-Apple_Silicon
os: macos-14
qt-version: 6.6
min-macOS-version: 14
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 \
-DCMAKE_UNITY_BUILD=1 \
-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 \
-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.name }}-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
os: windows-2022
qt-version: 6.6
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
run: |
New-Item -Force -ItemType Directory -Path .\build | Out-Null
cd build
cmake -S ..\input-leap -G "$env:CMAKE_GEN" -A x64 -D CMAKE_BUILD_TYPE=$B_BUILD_TYPE `
-DDNSSD_LIB="$env: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 build\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
- name: Build the Installer
if: 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: env.B_BUILD_TYPE == 'Release'
with:
name: windows-installer-${{ matrix.name }}
path: .\build\installer-inno\bin
if-no-files-found: error
freebsd-build:
name: freebsd-14-1
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Build on FreeBSD 14.1
id: test
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y \
cmake-core \
pkgconf \
git \
avahi-libdns \
libsm \
libxinerama \
libxrandr \
libxtst \
libxkbcommon \
glib \
ninja \
qt6-base \
qt6-tools \
qt6-declarative
run: |
git config --global --add safe.directory /home/runner/work/input-leap/input-leap
git submodule update --init --recursive
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_UNITY_BUILD=1 -DINPUTLEAP_BUILD_INSTALLER=OFF ..
cmake --build . --parallel
flatpak:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:kde-6.7
options: --privileged
steps:
# submodules require git to be installed
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
- run: git config --global protocol.file.allow always
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
name: "Build"
with:
bundle: input-leap.flatpak
manifest-path: dist/flatpak/io.github.input_leap.InputLeap.yml
cache-key: flatpak-builder-${{ github.sha }}
upload-artifact: false
- uses: actions/upload-artifact@v4
if: env.B_BUILD_TYPE == 'Release'
with:
name: input-leap-flatpak-x86_64
path: input-leap.flatpak
if-no-files-found: error