-
Notifications
You must be signed in to change notification settings - Fork 4
200 lines (172 loc) · 5.98 KB
/
Copy pathbuild-linux.yml
File metadata and controls
200 lines (172 loc) · 5.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
---
name: build-linux
on:
workflow_call:
jobs:
build-linux:
name: Build against Qt ${{ matrix.qt }} on ${{ matrix.container }}
runs-on: ubuntu-latest
strategy:
matrix:
container:
- debian:oldstable
- debian:stable
- debian:testing
- fedora:38
- fedora:42
- fedora:43
- fedora:rawhide
- ubuntu:latest
- ubuntu:rolling
qt: [5, 6]
include:
# add appimage to matrix
# NOTE: AppImage build fails for Qt6 on Debian-like systems
- container: ubuntu:latest
qt: 5
appimage: true
- container: fedora:38
qt: 6
appimage: true
- container: fedora:42
no_x11: true
- container: fedora:43
no_x11: true
- container: fedora:rawhide
no_x11: true
exclude:
# Debian Bullseye doesn't have Qt6
- container: debian:oldstable
qt: 6
fail-fast: false
container:
image: ${{ matrix.container }}
env:
DEBIAN_FRONTEND: noninteractive
DEBIAN_QT5_PACKAGES: qtbase5-dev qttools5-dev
DEBIAN_QT6_PACKAGES: qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libgl1-mesa-dev
DEBIAN_X11_PACKAGES: libx11-dev libxkbcommon-x11-dev libxtst-dev
REDHAT_QT5_PACKAGES: qt5-linguist
REDHAT_QT6_PACKAGES: qt6-qttools-devel
REDHAT_X11_PACKAGES: libX11-devel libXtst-devel libxkbcommon-x11-devel
steps:
- name: Detect OS release
run: |
. /etc/os-release && echo "OS_RELEASE_ID=${ID}" >>${GITHUB_ENV}
- name: Disable X11 dependencies
run: |
echo "CONFIGURE_NO_X11=-DDISABLE_FILL_FORM_SHORTCUTS=1" >>${GITHUB_ENV}
if: |
matrix.no_x11
- name: Add packages for AppImage Build
run: |
echo "APPIMAGE_PACKAGES=curl file nodejs" >>${GITHUB_ENV}
if: |
matrix.appimage
- name: Update for Debian systems
run: |
apt-get update -q -y
apt-get upgrade -q -y
if: |
env.OS_RELEASE_ID == 'debian' || env.OS_RELEASE_ID == 'ubuntu'
- name: Add X11 packages for Debian systems
run: |
echo "X11_PACKAGES=${DEBIAN_X11_PACKAGES}" >>${GITHUB_ENV}
if: |
matrix.no_x11 != true && ( env.OS_RELEASE_ID == 'debian' || env.OS_RELEASE_ID == 'ubuntu' )
- name: Install dependencies for Debian systems
run: >
apt-get install --no-install-recommends -q -y
ca-certificates
git
cmake
ninja-build
g++
libscrypt-dev
libssl-dev
${DEBIAN_QT${{ matrix.qt }}_PACKAGES}
${X11_PACKAGES}
${APPIMAGE_PACKAGES}
if: |
env.OS_RELEASE_ID == 'debian' || env.OS_RELEASE_ID == 'ubuntu'
- name: Update for RedHat systems
run: dnf upgrade -y
if: |
env.OS_RELEASE_ID == 'fedora'
- name: Add X11 packages for RedHat systems
run: |
echo "X11_PACKAGES=${REDHAT_X11_PACKAGES}" >>${GITHUB_ENV}
if: |
matrix.no_x11 != true && ( env.OS_RELEASE_ID == 'fedora' )
- name: Install dependencies for RedHat systems
run: >
dnf install --setopt=install_weak_deps=False -y
ca-certificates
git
cmake
ninja-build
gcc-c++
libscrypt-devel
openssl-devel
qt${{ matrix.qt }}-qtbase-devel
${REDHAT_QT${{ matrix.qt }}_PACKAGES}
${X11_PACKAGES}
${APPIMAGE_PACKAGES}
if: |
env.OS_RELEASE_ID == 'fedora'
# NOTE: execute *AFTER* dependency installation to ensure that it uses a git checkout!
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: |
rm -rf ${RUNNER_TEMP}/build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ${CONFIGURE_NO_X11} -B ${RUNNER_TEMP}/build .
- name: Build
run: cmake --build ${RUNNER_TEMP}/build
- name: Install
env:
LINUXDEPLOY_DIR: ${{ runner.temp }}/linuxdeploy
run: |
rm -rf ${LINUXDEPLOY_DIR}
cmake --install ${RUNNER_TEMP}/build --prefix ${LINUXDEPLOY_DIR}/AppDir/usr
- name: Test
run: |
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -B ${RUNNER_TEMP}/build .
cmake --build ${RUNNER_TEMP}/build --target test
- name: Download linuxdeploy
working-directory: ${{ runner.temp }}/linuxdeploy
run: >
curl
--silent --show-error
--location --remote-name-all
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
if: |
matrix.appimage
- name: Build AppImage
working-directory: ${{ runner.temp }}/linuxdeploy
env:
APPIMAGE_EXTRACT_AND_RUN: 1
QML_SOURCES_PATHS: ${{ github.workspace }}/src
run: >
mkdir -p AppDir/usr/translations &&
chmod +x ./*.AppImage &&
./linuxdeploy-x86_64.AppImage
--verbosity=2
--appdir=AppDir
--desktop-file=AppDir/usr/share/applications/qMasterPassword.desktop
--executable=AppDir/usr/bin/qMasterPassword
--icon-file=AppDir/usr/share/pixmaps/qmasterpassword.png
--plugin=qt
--output=appimage &&
file qMasterPassword-x86_64.AppImage
if: |
matrix.appimage
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: appimage-qt${{ matrix.qt }}
path: ${{ runner.temp }}/linuxdeploy/qMasterPassword-x86_64.AppImage
# skip step when running under act-cli
if: |
matrix.appimage && env.ACT != 'true'