Skip to content

qt6 crossbuild package release #23

qt6 crossbuild package release

qt6 crossbuild package release #23

name: qt6 crossbuild package release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name: [qt6-swizzin]
os_id: [debian, ubuntu]
os_version_id: [buster, bullseye, bookworm, bionic, focal, jammy]
arch: [amd64, armhf, arm64]
include:
- arch: amd64
CHOST: "x86_64-linux-gnu"
docker_arch: amd64
docker_platform: linux/amd64
- arch: armhf
CHOST: "arm-linux-gnueabihf"
docker_arch: arm32v7
docker_platform: linux/arm/v7
- arch: arm64
CHOST: "aarch64-linux-gnu"
docker_arch: arm64v8
docker_platform: linux/arm64/v8
exclude:
- os_id: debian
os_version_id: bionic
- os_id: debian
os_version_id: focal
- os_id: debian
os_version_id: jammy
- os_id: ubuntu
os_version_id: buster
- os_id: ubuntu
os_version_id: bullseye
- os_id: ubuntu
os_version_id: bookworm
name: ${{ matrix.arch }} ${{ matrix.os_id }}:${{ matrix.os_version_id }} ${{ matrix.name }}
env:
opt_dir_name: "opt/local"
qt_short_version: "6.6"
cxx_standard: "17"
prerelease: false
steps:
- uses: actions/checkout@v3
- name: Host - phased updates # https://github.com/actions/runner-images/issues/7192
run: echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
- name: Host - update
run: sudo apt-get update
- name: Host - upgrade
run: sudo apt-get -y upgrade
- name: Host - Install host qemu-static
run: sudo apt-get install -y qemu binfmt-support qemu-user-static
- name: Host - Docker multiarch bootstrap
run: sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Host - Create Docker template env file
run: |
echo "DEBIAN_FRONTEND=noninteractive" > env.custom
echo "LANG=en_US.UTF-8" >> env.custom
echo "LANGUAGE=en_US.UTF-8" >> env.custom
echo "LC_ALL=en_US.UTF-8" >> env.custom
echo "LC_CTYPE=en_US.UTF-8" >> env.custom
echo "PATH=/${{ env.opt_dir_name }}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> env.custom
echo "LD_LIBRARY_PATH=/${{ env.opt_dir_name }}/lib:/usr/lib/${{ matrix.CHOST }}:/usr/lib:/usr/local/lib" >> env.custom
echo "CHOST=${{ matrix.CHOST }}" >> env.custom
echo "CC=${{ matrix.CHOST }}-gcc" >> env.custom
echo "AR=${{ matrix.CHOST }}-ar" >> env.custom
echo "CXX=${{ matrix.CHOST }}-g++" >> env.custom
- name: Host - Create docker multiarch ${{ matrix.arch }} container
run: docker run --name multiarch -it -d --env-file env.custom -w /root -v ${{ github.workspace }}:/root ${{ matrix.os_id }}:${{ matrix.os_version_id }}
- name: Host - Create docker binary test ${{ matrix.arch }} container
run: docker run --name bintest -it -d --env-file env.custom -w /root --platform ${{ matrix.docker_platform }} -v ${{ github.workspace }}:/root ${{ matrix.docker_arch }}/${{ matrix.os_id }}:${{ matrix.os_version_id }}
- name: Docker target - Set locale data
run: |
docker exec --env-file env.custom multiarch /bin/bash -c 'echo LC_ALL=en_US.UTF-8 >> /etc/environment'
docker exec --env-file env.custom multiarch /bin/bash -c 'echo en_US.UTF-8 UTF-8 >> /etc/locale.gen'
docker exec --env-file env.custom multiarch /bin/bash -c 'echo LANG=en_US.UTF-8 > /etc/locale.conf'
- name: Docker target - fix Ubuntu sources
if: |
matrix.os_id == 'ubuntu' && matrix.arch != 'amd64'
run: |
docker exec --env-file env.custom -w /etc/apt/ multiarch bash -c 'echo "deb [arch=${{ matrix.arch }}] http://ports.ubuntu.com/ubuntu-ports ${{ matrix.os_version_id }} main restricted universe multiverse" > sources.list'
docker exec --env-file env.custom -w /etc/apt/ multiarch bash -c 'echo "deb [arch=${{ matrix.arch }}] http://ports.ubuntu.com/ubuntu-ports ${{ matrix.os_version_id }}-updates main restricted universe multiverse" >> sources.list'
docker exec --env-file env.custom -w /etc/apt/ multiarch bash -c 'echo "deb [arch=${{ matrix.arch }}] http://ports.ubuntu.com/ubuntu-ports ${{ matrix.os_version_id }}-security main restricted universe multiverse" >> sources.list'
docker exec --env-file env.custom -w /etc/apt/ multiarch bash -c 'echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${{ matrix.os_version_id }} main restricted universe multiverse" >> sources.list'
docker exec --env-file env.custom -w /etc/apt/ multiarch bash -c 'echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${{ matrix.os_version_id }}-updates main restricted universe multiverse" >> sources.list'
docker exec --env-file env.custom -w /etc/apt/ multiarch bash -c 'echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${{ matrix.os_version_id }}-backports restricted universe multiverse" >> sources.list'
docker exec --env-file env.custom -w /etc/apt/ multiarch bash -c 'echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu/ ${{ matrix.os_version_id }}-security main restricted universe multiverse" >> sources.list'
- name: Docker target - dpkg configure arch
run: docker exec --env-file env.custom multiarch dpkg --add-architecture ${{ matrix.arch }}
- name: Docker target - Run apt-get update
run: |
docker exec --env-file env.custom multiarch apt-get update
docker exec --env-file env.custom bintest apt-get update
- name: Docker target - fix locales
run: |
docker exec --env-file env.custom multiarch apt-get install -y locales
docker exec --env-file env.custom multiarch locale-gen en_US.UTF-8
docker exec --env-file env.custom multiarch dpkg-reconfigure locales
- name: Docker target - Run apt-get upgrade
run: |
docker exec --env-file env.custom multiarch apt-get upgrade -y
docker exec --env-file env.custom bintest apt-get upgrade -y
- name: Docker target - apt-get install the core build dependencies
run: |
docker exec --env-file env.custom multiarch apt-get install -y build-essential curl pkg-config automake libtool git perl python3 python3-dev unzip ccache
docker exec --env-file env.custom bintest apt-get install -y openssl binutils
- name: Docker target - apt-get install crossbuild-essential
if: matrix.arch != 'amd64'
run: docker exec --env-file env.custom multiarch apt-get install -y crossbuild-essential-${{ matrix.arch }}
- name: Docker target - apt-get install cross target deps
run: docker exec --env-file env.custom multiarch apt-get install -y zlib1g-dev:${{ matrix.arch }} libssl-dev:${{ matrix.arch }} libstdc++-*-dev:${{ matrix.arch }} libicu6*:${{ matrix.arch }} libicu-dev:${{ matrix.arch }} libgeoip-dev:${{ matrix.arch }}
- name: Docker target - apt-get install cross target deps - only buster
if: matrix.os_version_id == 'buster'
run: docker exec --env-file env.custom multiarch apt-get install -y libdouble-conversion1:${{ matrix.arch }} libdouble-conversion-dev:${{ matrix.arch }}
- name: Docker target - apt-get install cross target deps - no bionic or buster
if: matrix.os_version_id != 'bionic' && matrix.os_version_id != 'buster'
run: docker exec --env-file env.custom multiarch apt-get install -y libdouble-conversion3:${{ matrix.arch }} libdouble-conversion-dev:${{ matrix.arch }} libmd4c0:${{ matrix.arch }} libmd4c-dev:${{ matrix.arch }}
- name: Docker target - apt-get install cross target deps - no bionic or buster or focal
if: matrix.os_version_id != 'bionic' && matrix.os_version_id != 'focal' && matrix.os_version_id != 'buster'
run: docker exec --env-file env.custom multiarch apt-get install -y libmd4c-html0:${{ matrix.arch }} libmd4c-html0-dev:${{ matrix.arch }}
- name: Docker target - bionic - apt-get install gcc-8-base g++-8
if: matrix.arch == 'amd64' && matrix.os_version_id == 'bionic'
run: docker exec --env-file env.custom multiarch apt-get install -y gcc-8 g++-8
- name: Docker target - bionic - apt-get install gcc-8 g++-8 cross
if: matrix.arch != 'amd64' && matrix.os_version_id == 'bionic'
run: docker exec --env-file env.custom multiarch apt-get install -y cpp-8-${{ matrix.CHOST }} g++-8-${{ matrix.CHOST }} gcc-8-${{ matrix.CHOST }}
- name: Docker target - bionic - reconfigure build vars
if: matrix.os_version_id == 'bionic'
run: |
echo "CC=${{ matrix.CHOST }}-gcc-8" >> env.custom
echo "AR=${{ matrix.CHOST }}-gcc-ar-8" >> env.custom
echo "CXX=${{ matrix.CHOST }}-g++-8" >> env.custom
- name: Docker target - cmake and ninja download and install
run: |
docker exec --env-file env.custom multiarch curl -sNL "https://github.com/swizzin/cmake_crossbuild/releases/latest/download/${{ matrix.os_id }}-${{ matrix.os_version_id }}-cmake-swizzin-${{ matrix.arch }}.deb" -o ${{ matrix.os_id }}-${{ matrix.os_version_id }}-cmake-swizzin-${{ matrix.arch }}.deb
docker exec --env-file env.custom multiarch dpkg -i ${{ matrix.os_id }}-${{ matrix.os_version_id }}-cmake-swizzin-${{ matrix.arch }}.deb
- name: Docker target - qt get latest release info and set to env
run: |
qt_github_tag_list="$(git ls-remote -q -t --refs https://github.com/qt/qtbase.git | awk '{sub("refs/tags/", "");sub("(.*)(-[^0-9].*)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV)"
qt_github_tag="$(grep -Eom1 "v${{ env.qt_short_version }}.([0-9]{1,2})" <<< "${qt_github_tag_list}")"
echo "qt_version=${qt_github_tag/v/}" >> $GITHUB_ENV
- name: Docker target - qt set the download urls
run: |
echo "qt_qtbase_url=https://download.qt.io/official_releases/qt/${{ env.qt_short_version }}/${{ env.qt_version }}/submodules/qtbase-everywhere-src-${{ env.qt_version }}.tar.xz" >> $GITHUB_ENV
echo "qt_qttools_url=https://download.qt.io/official_releases/qt/${{ env.qt_short_version }}/${{ env.qt_version }}/submodules/qttools-everywhere-src-${{ env.qt_version }}.tar.xz" >> $GITHUB_ENV
- name: Docker target - qt qtbase - curl
run: |
docker exec --env-file env.custom multiarch curl -sNL ${{ env.qt_qtbase_url }} -o qtbase.tar.xz
docker exec --env-file env.custom multiarch tar xf qtbase.tar.xz
- name: Docker target - qt qtbase - cmake configure
run: |
docker exec --env-file env.custom -w /root/qtbase-everywhere-src-${{ env.qt_version }} multiarch cmake -Wno-dev -Wno-deprecated -G Ninja -B build \
-D QT_FEATURE_optimize_full=on \
-D QT_FEATURE_gui=OFF -D QT_FEATURE_widgets=OFF -D QT_FEATURE_dbus=OFF -D QT_FEATURE_openssl_linked=on \
-D QT_FEATURE_system_pcre2=off -D QT_FEATURE_system_harfbuzz=off -D QT_FEATURE_system_freetype=off \
-D QT_FEATURE_testlib=off -D QT_BUILD_EXAMPLES=off -D QT_BUILD_TESTS=off \
-D CMAKE_BUILD_TYPE="release" \
-D CMAKE_CXX_STANDARD="${{ env.cxx_standard }}" \
-D CMAKE_PREFIX_PATH="/${{ env.opt_dir_name }}" \
-D CMAKE_INSTALL_PREFIX="/root/build/${{ env.opt_dir_name }}"
continue-on-error: true
- name: Fix log permissions
run: |
sudo chmod 755 ${{ github.workspace }}/qtbase-everywhere-src-${{ env.qt_version }}/
sudo ls -la ${{ github.workspace }}/qtbase-everywhere-src-${{ env.qt_version }}/
#sudo ls -la ${{ github.workspace }}/qtbase-everywhere-src-${{ env.qt_version }}/build/
#sudo ls -la ${{ github.workspace }}/qtbase-everywhere-src-${{ env.qt_version }}/build/CMakeFiles
#sudo cp ${{ github.workspace }}/qtbase-everywhere-src-${{ env.qt_version }}/build/CMakeFiles/*.log /home/temp
- name: Archive logs
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch }}-${{ matrix.os_id }}-${{ matrix.os_version_id }}-${{ matrix.name }}-cmake-logs
path: qtbase-everywhere-src-${{ env.qt_version }}/build/CMakeFiles/*.log
- name: Docker target - qt qtbase - cmake build
run: docker exec --env-file env.custom -w /root/qtbase-everywhere-src-${{ env.qt_version }} multiarch cmake --build build
- name: Docker target - qt qtbase - cmake install
run: docker exec --env-file env.custom -w /root/qtbase-everywhere-src-${{ env.qt_version }} multiarch cmake --install build
- name: Docker target - qt qttools - curl
run: |
docker exec --env-file env.custom multiarch curl -sNL ${{ env.qt_qttools_url }} -o qttools.tar.xz
docker exec --env-file env.custom multiarch tar xf qttools.tar.xz
- name: Docker target - qt qttools - cmake configure
run: |
docker exec --env-file env.custom -w /root/qttools-everywhere-src-${{ env.qt_version }} multiarch cmake -Wno-dev -Wno-deprecated -G Ninja -B build \
-D CMAKE_BUILD_TYPE="release" \
-D CMAKE_CXX_STANDARD="${{ env.cxx_standard }}" \
-D CMAKE_PREFIX_PATH="/${{ env.opt_dir_name }}" \
-D CMAKE_INSTALL_PREFIX="/root/build/${{ env.opt_dir_name }}"
- name: Docker target - qt qttools - cmake build
run: docker exec --env-file env.custom -w /root/qttools-everywhere-src-${{ env.qt_version }} multiarch cmake --build build
- name: Docker target - qt qttools - cmake install
run: docker exec --env-file env.custom -w /root/qttools-everywhere-src-${{ env.qt_version }} multiarch cmake --install build
- name: Docker target - Set deb dependencies for qt
run: echo "qt-deb-deps=zlib1g,openssl" >> $GITHUB_ENV
- name: Docker target - ldconfig - create /etc/ld.so.conf.d/qt6.conf
run: |
docker exec --env-file env.custom -w /root/build multiarch mkdir -p DEBIAN
docker exec --env-file env.custom -w /root/build/DEBIAN multiarch bash -c "echo -e '#!/usr/bin/env bash\nldconfig' > postinst"
docker exec --env-file env.custom -w /root/build/DEBIAN multiarch bash -c "chmod +x postinst"
docker exec --env-file env.custom -w /root/build multiarch mkdir -p etc/ld.so.conf.d
docker exec --env-file env.custom -w /root/build/etc/ld.so.conf.d multiarch bash -c "echo '/${{ env.opt_dir_name }}/lib' > qt6.conf"
- name: Host - Create deb packages
uses: jiro4989/build-deb-action@v3
with:
package: "${{ matrix.name }}"
package_root: build
maintainer: swizzin
compress_type: gzip
version: "${{ env.qt_version }}"
depends: "${{ env.qt-deb-deps }}"
arch: "${{ matrix.arch }}"
desc: "${{ matrix.name }}-${{ matrix.arch }} for ${{ matrix.os_id }}-${{ matrix.os_version_id }}"
- name: Host - Remove version from release name and use hyphens
run: mv -f "${{ matrix.name }}_${{ env.qt_version }}_${{ matrix.arch }}.deb" "${{ matrix.os_id }}-${{ matrix.os_version_id }}-${{ matrix.name }}-${{ matrix.arch }}.deb"
- name: Host - "Create release - tag - assets"
uses: ncipollo/release-action@v1
with:
prerelease: ${{ env.prerelease }}
artifacts: "${{ matrix.os_id }}-${{ matrix.os_version_id }}-${{ matrix.name }}-${{ matrix.arch }}.deb"
replacesArtifacts: true
tag: "${{ env.qt_version }}"
name: "qt ${{ env.qt_version }}"
body: "Built with cmake using v${{ env.qt_version }} from github on amd64 arm64 armhf for Debian Buster Bullseye Bookworm and Ubuntu Bionic Focal Jammy"
allowUpdates: true
token: "${{ secrets.GITHUB_TOKEN }}"