1
- name : cmake ninja crossbuild package release
1
+ name : qt6 crossbuild package release
2
2
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
6
skip_rerun :
7
7
description : " Skip rerun?"
8
8
required : true
9
- default : true
10
9
type : boolean
11
10
retries :
12
- description : " Number of rerun retries"
11
+ description : ' Number of rerun retries'
13
12
required : true
14
- default : " 1 "
13
+ default : ' 5 '
15
14
type : choice
16
- options : ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
15
+ options : [ "1", "2", "3", "4", "5", "6", "7", "8", "9" ]
17
16
18
17
concurrency :
19
18
group : ${{ github.workflow }}-${{ github.ref }}
@@ -26,12 +25,11 @@ jobs:
26
25
build :
27
26
runs-on : ubuntu-latest
28
27
outputs :
29
- cmake_version : ${{ steps.version_info.outputs.cmake_version }}
30
- ninja_version : ${{ steps.version_info.outputs.ninja_version }}
28
+ qt_version : ${{ steps.version_info.outputs.qt_version }}
31
29
strategy :
32
30
fail-fast : false
33
31
matrix :
34
- name : [cmake -swizzin]
32
+ name : [qt6 -swizzin]
35
33
os_id : [debian, ubuntu]
36
34
os_codename : [bullseye, bookworm, focal, jammy, noble]
37
35
arch : [amd64, armhf, arm64]
@@ -47,10 +45,12 @@ jobs:
47
45
- os_id : ubuntu
48
46
os_codename : bookworm
49
47
48
+
50
49
name : ${{ matrix.os_id }}:${{ matrix.os_codename }} ${{ matrix.name }} ${{ matrix.arch }}
51
50
52
51
env :
53
52
opt_dir_name : " opt/local"
53
+ qt_short_version : " 6.5"
54
54
cxx_standard : " 17"
55
55
GH_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
56
56
@@ -62,18 +62,24 @@ jobs:
62
62
- name : Host - phased updates
63
63
run : printf '%s\n' 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
64
64
65
+ # Bootstrap Ubuntu Lunar repo so that we can install specific app we may need, like binfmt and qemu-user-static
66
+ - name : Host - set up lunar repo -t lunar
67
+ run : |
68
+ printf '%b\n' 'Package: *\nPin: release n=lunar\nPin-Priority: 50' | sudo tee /etc/apt/preferences
69
+ printf '%s\n' 'deb http://archive.ubuntu.com/ubuntu/ lunar main universe restricted' | sudo tee /etc/apt/sources.list.d/lunar.list
70
+
65
71
- name : Host - update
66
72
run : sudo apt-get update
67
73
68
- - name : Host - upgrade
69
- run : sudo apt-get -y upgrade
74
+ # - name: Host - upgrade
75
+ # run: sudo apt-get -y upgrade
70
76
71
- # No action or other method to bootstrap binfmt-support and qemu-user-static on the host runner
72
- - name : Host - set up qemu-user-static binfmt-support
73
- run : sudo apt install libpipeline1 qemu-user-static binfmt-support
77
+ # No action or other method to bootstrap binfmt. Install from lunar and we get the latest versions and full docker support
78
+ - name : Host - set up qemu-user-static binfmt-support from lunar
79
+ run : sudo apt install -t lunar libpipeline1 qemu-user-static binfmt-support
74
80
75
81
# Why are we doing it like this and not using a container setup? That's how you're supposed to do it, right?
76
- # qemu-user-static and binfmt-support are not part of the runner images https://github.com/actions/runner-images?tab=readme-ov-file#available- images
82
+ # qemu-user-static and binfmt-support are not part of the runner images https://github.com/actions/runner-images/blob/main/ images/linux/Ubuntu2204-Readme.md
77
83
# We would need to modify the runner to install these before the container starts. Which you cannot do as there is no way to bootstrap the host.
78
84
# So we install them on the host then create/pull a custom docker image that we use to build the multiarch targets.
79
85
# We are always on the host runner but can use any docker image we need with the access the qemu emulation when required.
@@ -88,77 +94,126 @@ jobs:
88
94
- name : Host - Create docker multiarch ${{ matrix.arch }} container
89
95
run : docker run --name multiarch -it -d -u 1001 -v ${{ github.workspace }}:/home/github ghcr.io/userdocs/dcb:${{ matrix.os_id }}-${{ matrix.os_codename }}-${{ matrix.arch }}
90
96
91
- - name : Host - cmake set cmake_github_tag
92
- run : printf '%s\n' "cmake_github_tag=$(git ls-remote -q -t --refs https://github.com/Kitware/CMake.git | awk '{sub("refs/tags/", "");sub("(.*)-rc(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n 1)" >> $GITHUB_ENV
97
+ - name : Docker - cmake and ninja download and install
98
+ run : |
99
+ docker exec multiarch curl -sNL "https://github.com/swizzin/cmake_crossbuild/releases/latest/download/${{ matrix.os_id }}-${{ matrix.os_codename }}-cmake-swizzin-${{ matrix.arch }}.deb" -o ${{ matrix.os_id }}-${{ matrix.os_codename }}-cmake-swizzin-${{ matrix.arch }}.deb
100
+ docker exec multiarch sudo dpkg -i ${{ matrix.os_id }}-${{ matrix.os_codename }}-cmake-swizzin-${{ matrix.arch }}.deb
101
+
102
+ - name : Docker - zlib-ng download and install
103
+ run : |
104
+ docker exec multiarch curl -sNL "https://github.com/userdocs/zlib-ng-crossbuild/releases/latest/download/${{ matrix.os_id }}-${{ matrix.os_codename }}-zlib-ng-${{ matrix.arch }}.deb" -o ${{ matrix.os_id }}-${{ matrix.os_codename }}-zlib-ng-${{ matrix.arch }}.deb
105
+ docker exec multiarch sudo dpkg -i ${{ matrix.os_id }}-${{ matrix.os_codename }}-zlib-ng-${{ matrix.arch }}.deb
93
106
94
- - name : Host - ninja set ninja_github_tag
95
- run : printf '%s\n' "ninja_github_tag=$(git ls-remote -q -t --refs https://github.com/ninja-build/ninja.git | awk '/v/{sub("refs/tags/", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n 1)" >> $GITHUB_ENV
107
+ - name : Docker - openssl download and install
108
+ run : |
109
+ docker exec multiarch curl -sNL "https://github.com/userdocs/openssl-crossbuild/releases/latest/download/${{ matrix.os_id }}-${{ matrix.os_codename }}-openssl-${{ matrix.arch }}.deb" -o ${{ matrix.os_id }}-${{ matrix.os_codename }}-openssl-${{ matrix.arch }}.deb
110
+ docker exec multiarch sudo dpkg -i ${{ matrix.os_id }}-${{ matrix.os_codename }}-openssl-${{ matrix.arch }}.deb
96
111
97
- - name : Host - Git clone cmake
98
- run : git clone --single-branch --branch ${{ env.cmake_github_tag }} --shallow-submodules --recurse-submodules --depth 1 https://github.com/Kitware/CMake.git cmake
112
+ - name : Host - qt get latest release info and create env and urls
113
+ id : version_info
114
+ run : |
115
+ qt_version="$(git ls-remote -q -t --refs https://github.com/qt/qtbase.git | awk '/'"${qt_short_version}"'/{sub("refs/tags/v", "");sub("(.*)(-[^0-9].*)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n 1)"
99
116
100
- - name : Docker - Configure cmake
101
- run : docker exec -w /home/github/cmake multiarch ./configure --parallel=$(nproc) --no-system-libs --enable-ccache --prefix=/home/github/build/${{ env.opt_dir_name}}
117
+ read -ra qt_version_short_array <<< "${qt_version//\./ }"
118
+ qt_short_version="${qt_version_short_array[0]}.${qt_version_short_array[1]}"
102
119
103
- - name : Docker - Make build cmake
104
- run : docker exec -w /home/github/cmake multiarch make -j $(nproc)
120
+ printf '%s\n' "qt_qtbase_url=https://download.qt.io/official_releases/qt/${qt_short_version}/${qt_version}/submodules/qtbase-everywhere-src-${qt_version}.tar.xz" >> $GITHUB_ENV
121
+ printf '%s\n' "qt_qttools_url=https://download.qt.io/official_releases/qt/${qt_short_version}/${qt_version}/submodules/qttools-everywhere-src-${qt_version}.tar.xz" >> $GITHUB_ENV
105
122
106
- - name : Docker - Make install cmake
107
- run : docker exec -w /home/github/cmake multiarch make install
123
+ printf '%s\n' "qt_short_version=${qt_short_version}" >> $GITHUB_ENV
124
+ printf '%s\n' "qt_version=${qt_version}" >> $GITHUB_ENV
125
+ printf '%s\n' "qt_version=${qt_version}" >> $GITHUB_OUTPUT
108
126
109
- - name : Host - Git clone ninja
110
- run : git clone --single-branch --branch ${{ env.ninja_github_tag }} --shallow-submodules --recurse-submodules --depth 1 https://github.com/ninja-build/ninja.git ninja
127
+ - name : Host - qt qtbase - curl
128
+ run : curl -sNL ${{ env.qt_qtbase_url }} -o qtbase.tar.xz && tar xf qtbase.tar.xz
111
129
112
- - name : Docker - Configure ninja
130
+ - name : Docker - qt qtbase - cmake configure
113
131
run : >
114
- docker exec -w /home/github/ninja multiarch /home/github/build/ ${{ env.opt_dir_name }}/bin/ cmake -B build
132
+ docker exec -w /home/github/qtbase-everywhere-src- ${{ env.qt_version }} multiarch cmake -Wno-dev -Wno-deprecated -G Ninja -B build
115
133
-D CMAKE_BUILD_TYPE="release"
134
+ -D CMAKE_CXX_FLAGS="-lstdc++fs"
135
+ -D CMAKE_EXE_LINKER_FLAGS="-lstdc++fs"
136
+ -D QT_FEATURE_optimize_full=on
137
+ -D FEATURE_glib=OFF
138
+ -D QT_FEATURE_gui=off -D QT_FEATURE_openssl_linked=on -D QT_FEATURE_dbus=off
139
+ -D QT_FEATURE_system_pcre2=off -D QT_FEATURE_widgets=off
140
+ -D FEATURE_androiddeployqt=OFF -D FEATURE_animation=OFF
141
+ -D QT_FEATURE_testlib=off -D QT_BUILD_EXAMPLES=off -D QT_BUILD_TESTS=off
142
+ -D QT_BUILD_EXAMPLES_BY_DEFAULT=OFF -D QT_BUILD_TESTS_BY_DEFAULT=OFF
143
+ -D QT_FEATURE_gui=OFF -D QT_FEATURE_widgets=OFF -D QT_FEATURE_dbus=OFF -D QT_FEATURE_openssl_linked=on
144
+ -D QT_FEATURE_system_pcre2=off -D QT_FEATURE_system_harfbuzz=off -D QT_FEATURE_system_freetype=off
116
145
-D CMAKE_CXX_STANDARD="${{ env.cxx_standard }}"
146
+ -D CMAKE_PREFIX_PATH="/${{ env.opt_dir_name }}"
117
147
-D CMAKE_INSTALL_PREFIX="/home/github/build/${{ env.opt_dir_name }}"
148
+ continue-on-error : true
118
149
119
- - name : Docker - Build ninja
120
- run : docker exec -w /home/github/ninja multiarch /home/github/build/${{ env.opt_dir_name }}/bin/cmake --build build -j"$(nproc)"
150
+ - name : Archive logs
151
+ if : failure()
152
+ uses : actions/upload-artifact@v3
153
+ with :
154
+ name : ${{ matrix.arch }}-${{ matrix.os_id }}-${{ matrix.os_codename }}-${{ matrix.name }}-cmake-logs
155
+ path : qtbase-everywhere-src-${{ env.qt_version }}/build/
121
156
122
- - name : Docker - Install ninja
123
- run : docker exec -w /home/github/ninja multiarch /home/github/build/ ${{ env.opt_dir_name }}/bin/ cmake --install build
157
+ - name : Docker - qt qtbase - cmake build
158
+ run : docker exec -w /home/github/qtbase-everywhere-src- ${{ env.qt_version }} multiarch cmake --build build
124
159
125
- - name : Docker - Test cmake and ninja binaries and set versions
126
- run : |
127
- docker exec -w /home/github multiarch bash -c '/home/github/build/${{ env.opt_dir_name }}/bin/cmake --version 2> /dev/null | awk "NR==1{print \$3}" > cmake.version'
128
- docker exec -w /home/github multiarch bash -c '/home/github/build/${{ env.opt_dir_name }}/bin/ninja --version 2> /dev/null > ninja.version'
160
+ - name : Docker - qt qtbase - cmake install
161
+ run : docker exec -w /home/github/qtbase-everywhere-src-${{ env.qt_version }} multiarch cmake --install build
129
162
130
- - name : Host - Set cmake and ninja versions to variable
131
- id : version_info
132
- run : |
133
- cmake_version="$(<cmake.version)" cmake_version="${cmake_version%%-*}"
134
- printf '%s\n' "cmake_version=${cmake_version}" >> $GITHUB_ENV
163
+ - name : Docker - qt qttools - curl
164
+ run : curl -sNL ${{ env.qt_qttools_url }} -o qttools.tar.xz && tar xf qttools.tar.xz
135
165
136
- ninja_version="$(<ninja.version)" ninja_version="${ninja_version%\.git}"
137
- printf '%s\n' "ninja_version=${ninja_version}" >> $GITHUB_ENV
166
+ - name : Docker - qt qttools - cmake configure
167
+ run : >
168
+ docker exec -w /home/github/qttools-everywhere-src-${{ env.qt_version }} multiarch cmake -Wno-dev -Wno-deprecated -G Ninja -B build
169
+ -D CMAKE_BUILD_TYPE="release"
170
+ -D CMAKE_CXX_STANDARD="${{ env.cxx_standard }}"
171
+ -D CMAKE_PREFIX_PATH="/${{ env.opt_dir_name }}"
172
+ -D CMAKE_INSTALL_PREFIX="/home/github/build/${{ env.opt_dir_name }}"
138
173
139
- printf '%s\n' "cmake_version=${cmake_version}" >> $GITHUB_OUTPUT
140
- printf '%s\n' "ninja_version=${ninja_version}" >> $GITHUB_OUTPUT
174
+ - name : Docker - qt qttools - cmake build
175
+ run : docker exec -w /home/github/qttools-everywhere-src-${{ env.qt_version }} multiarch cmake --build build
141
176
142
- - name : Host - Set deb dependencies for cmake and ninja
143
- run : printf '%s\n' "cmake-deb-deps=openssl" >> $GITHUB_ENV
177
+ - name : Docker - qt qttools - cmake install
178
+ run : docker exec -w /home/github/qttools-everywhere-src-${{ env.qt_version }} multiarch cmake --install build
179
+
180
+ - name : Docker - Set deb dependencies for qt
181
+ run : |
182
+ icu="$(docker exec multiarch apt-cache search --names-only libicu[0-9]+$ | sort -r | head -n1 | awk '{print $1}')"
183
+ double_conversion="$(docker exec multiarch apt-cache search --names-only libdouble-conversion[0-9]$ | sort -r | head -n1 | awk '{print $1}')"
184
+
185
+ if [[ ${{ matrix.os_codename }} =~ ^(bullseye|jammy)$ ]]; then
186
+ md4c_html="$(docker exec multiarch apt-cache search --names-only libmd4c-html0$ | sort -r | head -n1 | awk '{print $1}')"
187
+ printf '%s\n' "qt-deb-deps=zlib-ng,openssl,${icu},${double_conversion},${md4c_html}" >> $GITHUB_ENV
188
+ else
189
+ printf '%s\n' "qt-deb-deps=zlib-ng,openssl,${icu},${double_conversion}" >> $GITHUB_ENV
190
+ fi
191
+
192
+ - name : Docker - ldconfig - create /etc/ld.so.conf.d/qt6.conf
193
+ run : |
194
+ docker exec -w /home/github/build multiarch mkdir -p DEBIAN
195
+ docker exec -w /home/github/build/DEBIAN multiarch bash -c "printf '%b\n' '#!/usr/bin/env bash\nldconfig' > postinst"
196
+ docker exec -w /home/github/build/DEBIAN multiarch bash -c "chmod +x postinst"
197
+ docker exec -w /home/github/build multiarch mkdir -p etc/ld.so.conf.d
198
+ docker exec -w /home/github/build/etc/ld.so.conf.d multiarch bash -c "printf '%s\n' '/${{ env.opt_dir_name }}/lib' > qt6.conf"
144
199
145
200
- name : Host - Create deb packages
146
201
uses : jiro4989/build-deb-action@v3
147
202
with :
148
203
package : " ${{ matrix.name }}"
149
204
package_root : build
150
- maintainer : userdocs
205
+ maintainer : swizzin
151
206
compress_type : gzip
152
- version : " ${{ env.cmake_version }}+${{ env.ninja_version }}"
153
- depends : " ${{ env.cmake -deb-deps }}"
207
+ version : " ${{ env.qt_version }}"
208
+ depends : " ${{ env.qt -deb-deps }}"
154
209
arch : " ${{ matrix.arch }}"
155
210
desc : " ${{ matrix.name }}-${{ matrix.arch }} for ${{ matrix.os_id }}-${{ matrix.os_codename }}"
156
211
157
212
- name : Host - Remove version from release name and use hyphens
158
- run : mv -f "${{ matrix.name }}_${{ env.cmake_version }}+${{ env.ninja_version }}_${{ matrix.arch }}.deb" "${{ matrix.os_id }}-${{ matrix.os_codename }}-${{ matrix.name }}-${{ matrix.arch }}.deb"
213
+ run : mv -f "${{ matrix.name }}_${{ env.qt_version }}_${{ matrix.arch }}.deb" "${{ matrix.os_id }}-${{ matrix.os_codename }}-${{ matrix.name }}-${{ matrix.arch }}.deb"
159
214
160
- - name : Host - upload artifacts
161
- uses : actions/upload-artifact@v4
215
+ - name : Host - upload deb packages
216
+ uses : actions/upload-artifact@v3
162
217
with :
163
218
name : " ${{ matrix.os_id }}-${{ matrix.os_codename }}-${{ matrix.name }}-${{ matrix.arch }}-deb"
164
219
path : " ${{ matrix.os_id }}-${{ matrix.os_codename }}-${{ matrix.name }}-${{ matrix.arch }}.deb"
@@ -170,14 +225,13 @@ jobs:
170
225
if : always() && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
171
226
env :
172
227
GH_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
173
- cmake_version : ${{ needs.build.outputs.cmake_version }}
174
- ninja_version : ${{ needs.build.outputs.ninja_version }}
228
+ qt_version : ${{ needs.build.outputs.qt_version }}
175
229
steps :
176
230
- name : Checkout
177
231
uses : actions/checkout@v4
178
232
179
233
- name : Host - Download artifacts
180
- uses : actions/download-artifact@v4
234
+ uses : actions/download-artifact@v3
181
235
182
236
- name : Host - artifacts organise for release
183
237
run : |
@@ -192,9 +246,9 @@ jobs:
192
246
prerelease : false
193
247
artifacts : releases/*.deb
194
248
replacesArtifacts : true
195
- tag : " ${{ env.cmake_version }}_${{ env.ninja_version }}"
196
- name : " cmake ${{ env.cmake_version }} ninja ${{ env.ninja_version }}"
197
- body : " cmake and ninja built from github latest release on amd64 arm64 armhf for: Debian Bullseye Bookworm - Ubuntu Focal Jammy Noble "
249
+ tag : " ${{ env.qt_version }}"
250
+ name : " qt ${{ env.qt_version }}"
251
+ body : " Built with cmake using v${{ env.qt_version }} from github on amd64 arm64 armhf for Debian Bullseye/ Bookworm and Ubuntu Focal/ Jammy"
198
252
allowUpdates : true
199
253
200
254
rerun-on-failure :
@@ -205,10 +259,10 @@ jobs:
205
259
actions : write
206
260
runs-on : ubuntu-latest
207
261
env :
208
- GH_TOKEN : " ${{ github.TOKEN }}"
262
+ GH_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
209
263
steps :
210
264
- uses : actions/checkout@v4
211
265
- name : Trigger rerun workflow on job failures
212
266
run : |
213
- inputs_retries ="${{ inputs.retries }}"
214
- gh workflow run rerun.yml -f run_id=${{ github.run_id }} -f attempts=${{ github.run_attempt }} -f retries=${inputs_retries:-1 }
267
+ inputs_value ="${{ inputs.retries }}"
268
+ gh workflow run rerun.yml -f run_id=${{ github.run_id }} -f attempts=${{ github.run_attempt }} -f retries=${inputs_value:-3 }
0 commit comments