diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 83a37e3..ea23006 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -8,17 +8,25 @@ jobs: strategy: fail-fast: false matrix: - distro: ['jammy'] - qbs_version: ['1.22.1', '1.23.2', '1.24.1'] - clang_major: [14, 15, 16] - gcc_major: [10, 11, 12] + distro: ['lunar'] + qbs_version: ['1.23.2', '1.24.1', '2.0.0'] + clang: [ + {major: 14, source: 'apt'}, + {major: 15, source: 'apt'}, + {major: 16, source: 'apt'} + ] + gcc: [ + {major: 11, source: 'apt'}, + {major: 12, source: 'apt'}, + {major: 13, source: 'apt'} + ] qt_version: ['6.4.3', '6.5.0'] include: - - distro: jammy - qbs_version: '1.24.1' - clang_major: 16 - gcc_major: 12 + - distro: lunar + qbs_version: '2.0.0' + clang: {major: 16, source: 'apt'} + gcc: {major: 13, source: 'apt'} qt_version: '6.5.0' gcc_tags: arbmind/qbs-gcc:latest gcc_qt_tags: arbmind/qbs-gcc-qt:latest @@ -40,75 +48,82 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Qbs ${{ matrix.qbs_version }} + GCC ${{ matrix.gcc_major }} + - name: Qbs ${{ matrix.qbs_version }} + GCC ${{ matrix.gcc.major }} uses: docker/build-push-action@v3 with: # buildkitd-flags: --debug target: qbs-gcc push: ${{ github.event_name != 'pull_request' }} tags: | - arbmind/qbs-gcc:${{ matrix.qbs_version }}-${{ matrix.gcc_major }} + arbmind/qbs-gcc:${{ matrix.qbs_version }}-${{ matrix.gcc.major }} ${{ matrix.gcc_tags }} build-args: | DISTRO=${{ matrix.distro }} - GCC_MAJOR=${{ matrix.gcc_major }} + GCC_MAJOR=${{ matrix.gcc.major }} + GCC_SOURCE=${{ matrix.gcc.source }} QT_VERSION=${{ matrix.qt_version }} QBS_VERSION=${{ matrix.qbs_version }} - - name: Qbs ${{ matrix.qbs_version }} + GCC ${{ matrix.gcc_major }} + Qt ${{ matrix.qt_version }} + - name: Qbs ${{ matrix.qbs_version }} + GCC ${{ matrix.gcc.major }} + Qt ${{ matrix.qt_version }} uses: docker/build-push-action@v3 with: target: qbs-gcc-qt push: ${{ github.event_name != 'pull_request' }} tags: | - arbmind/qbs-gcc-qt:${{ matrix.qbs_version }}-${{ matrix.gcc_major }}-${{ matrix.qt_version }} + arbmind/qbs-gcc-qt:${{ matrix.qbs_version }}-${{ matrix.gcc.major }}-${{ matrix.qt_version }} ${{ matrix.gcc_qt_tags }} build-args: | DISTRO=${{ matrix.distro }} - GCC_MAJOR=${{ matrix.gcc_major }} + GCC_MAJOR=${{ matrix.gcc.major }} + GCC_SOURCE=${{ matrix.gcc.source }} QT_VERSION=${{ matrix.qt_version }} QBS_VERSION=${{ matrix.qbs_version }} - - name: Qbs ${{ matrix.qbs_version }} + Clang ${{ matrix.clang_major }} + - name: Qbs ${{ matrix.qbs_version }} + Clang ${{ matrix.clang.major }} uses: docker/build-push-action@v3 with: target: qbs-clang push: ${{ github.event_name != 'pull_request' }} tags: | - arbmind/qbs-clang:${{ matrix.qbs_version }}-${{ matrix.clang_major }} + arbmind/qbs-clang:${{ matrix.qbs_version }}-${{ matrix.clang.major }} ${{ matrix.clang_tags }} build-args: | DISTRO=${{ matrix.distro }} - CLANG_MAJOR=${{ matrix.clang_major }} + CLANG_MAJOR=${{ matrix.clang.major }} + CLANG_SOURCE=${{ matrix.clang.source }} QT_VERSION=${{ matrix.qt_version }} QBS_VERSION=${{ matrix.qbs_version }} - - name: Qbs ${{ matrix.qbs_version }} + Clang ${{ matrix.clang_major }} + LibStdC++ ${{ matrix.gcc_major }} + - name: Qbs ${{ matrix.qbs_version }} + Clang ${{ matrix.clang.major }} + LibStdC++ ${{ matrix.gcc.major }} uses: docker/build-push-action@v3 with: target: qbs-clang-libstdcpp push: ${{ github.event_name != 'pull_request' }} tags: | - arbmind/qbs-clang-libstdcpp:${{ matrix.qbs_version }}-${{ matrix.clang_major }}-${{ matrix.gcc_major }} + arbmind/qbs-clang-libstdcpp:${{ matrix.qbs_version }}-${{ matrix.clang.major }}-${{ matrix.gcc.major }} ${{ matrix.clang_libstdcpp_tags }} build-args: | DISTRO=${{ matrix.distro }} - CLANG_MAJOR=${{ matrix.clang_major }} - GCC_MAJOR=${{ matrix.gcc_major }} + CLANG_MAJOR=${{ matrix.clang.major }} + CLANG_SOURCE=${{ matrix.clang.source }} + GCC_MAJOR=${{ matrix.gcc.major }} + GCC_SOURCE=${{ matrix.gcc.source }} QT_VERSION=${{ matrix.qt_version }} QBS_VERSION=${{ matrix.qbs_version }} - - name: Qbs ${{ matrix.qbs_version }} + Clang ${{ matrix.clang_major }} + LibStdC++ ${{ matrix.gcc_major }} + Qt ${{ matrix.qt_version }} + - name: Qbs ${{ matrix.qbs_version }} + Clang ${{ matrix.clang.major }} + LibStdC++ ${{ matrix.gcc.major }} + Qt ${{ matrix.qt_version }} uses: docker/build-push-action@v3 with: target: qbs-clang-libstdcpp-qt push: ${{ github.event_name != 'pull_request' }} tags: | - arbmind/qbs-clang-libstdcpp-qt:${{ matrix.qbs_version }}-${{ matrix.clang_major }}-${{ matrix.gcc_major }}-${{ matrix.qt_version }} + arbmind/qbs-clang-libstdcpp-qt:${{ matrix.qbs_version }}-${{ matrix.clang.major }}-${{ matrix.gcc.major }}-${{ matrix.qt_version }} ${{ matrix.clang_libstdcpp_qt_tags }} build-args: | DISTRO=${{ matrix.distro }} - CLANG_MAJOR=${{ matrix.clang_major }} - GCC_MAJOR=${{ matrix.gcc_major }} + CLANG_MAJOR=${{ matrix.clang.major }} + CLANG_SOURCE=${{ matrix.clang.source }} + GCC_MAJOR=${{ matrix.gcc.major }} + GCC_SOURCE=${{ matrix.gcc.source }} QT_VERSION=${{ matrix.qt_version }} QBS_VERSION=${{ matrix.qbs_version }} diff --git a/Dockerfile b/Dockerfile index f8a366e..e3ef4b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,20 @@ -ARG DISTRO=focal -ARG CLANG_MAJOR=14 -ARG GCC_MAJOR=11 -ARG QT_VERSION=6.2.4 +ARG DISTRO=lunar +ARG CLANG_MAJOR=16 +# clang source options: +# apt - directly use apt version +# llvm - add llvm distro repo +ARG CLANG_SOURCE=apt +ARG GCC_MAJOR=13 +# gcc source options: +# apt - directly use apt version +# ppa - add toolchain ppa +ARG GCC_SOURCE=apt +ARG QT_VERSION=6.5.0 ARG QT_ARCH=gcc_64 ARG QT_MODULES="" -ARG QBS_VERSION="1.21.0" +ARG QBS_VERSION="2.0.0" ARG QBS_URL="https://download.qt.io/official_releases/qbs/${QBS_VERSION}/qbs-linux-x86_64-${QBS_VERSION}.tar.gz" -ARG RUNTIME_APT="libicu70 libgssapi-krb5-2 libdbus-1-3 libpcre2-16-0" +ARG RUNTIME_APT="libicu72 libgssapi-krb5-2 libdbus-1-3 libpcre2-16-0" # base Qt setup @@ -58,6 +66,7 @@ RUN \ FROM ubuntu:${DISTRO} AS gcc_base ARG DISTRO ARG GCC_MAJOR +ARG GCC_SOURCE ARG RUNTIME_APT ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 ARG DEBIAN_FRONTEND=noninteractive @@ -75,9 +84,11 @@ RUN \ ca-certificates \ gnupg \ wget \ - && wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60c317803a41ba51845e371a1e9377a2ba9ef27f" | apt-key add - \ - && echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${DISTRO} main" > /etc/apt/sources.list.d/gcc.list \ - && apt-get update --quiet \ + && if [ "$GCC_SOURCE" = "ppa" ] ; then \ + wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60c317803a41ba51845e371a1e9377a2ba9ef27f" | apt-key add - \ + && echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${DISTRO} main" > /etc/apt/sources.list.d/gcc.list \ + && apt-get update --quiet \ + ; fi \ && apt-get install --yes --quiet --no-install-recommends \ libstdc++-${GCC_MAJOR}-dev \ gcc-${GCC_MAJOR} \ @@ -145,6 +156,7 @@ ENTRYPOINT ["/opt/qbs/bin/qbs"] FROM ubuntu:${DISTRO} AS clang_base ARG DISTRO ARG CLANG_MAJOR +ARG CLANG_SOURCE ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 ARG DEBIAN_FRONTEND=noninteractive ARG RUNTIME_APT @@ -162,9 +174,11 @@ RUN apt-get update --quiet \ gnupg \ apt-transport-https \ ca-certificates \ - && wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ - && echo "deb http://apt.llvm.org/${DISTRO}/ llvm-toolchain-${DISTRO}-${CLANG_MAJOR} main" > /etc/apt/sources.list.d/llvm.list \ - && apt-get update --quiet \ + && if [ "$CLANG_SOURCE" = "llvm" ] ; then \ + wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ + && echo "deb http://apt.llvm.org/${DISTRO}/ llvm-toolchain-${DISTRO}-${CLANG_MAJOR} main" > /etc/apt/sources.list.d/llvm.list \ + && apt-get update --quiet \ + ; fi \ && apt-get install --yes --quiet --no-install-recommends \ ${RUNTIME_APT} \ clang-${CLANG_MAJOR} \ @@ -210,13 +224,16 @@ ENTRYPOINT ["/opt/qbs/bin/qbs"] FROM clang_base AS clang_libstdcpp_base ARG DISTRO ARG GCC_MAJOR +ARG GCC_SOURCE ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 ARG DEBIAN_FRONTEND=noninteractive RUN \ - wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60c317803a41ba51845e371a1e9377a2ba9ef27f" | apt-key add - \ - && echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${DISTRO} main" > /etc/apt/sources.list.d/gcc.list \ - && apt-get update --quiet \ + if [ "$GCC_SOURCE" = "ppa" ] ; then \ + wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60c317803a41ba51845e371a1e9377a2ba9ef27f" | apt-key add - \ + && echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${DISTRO} main" > /etc/apt/sources.list.d/gcc.list \ + && apt-get update --quiet \ + ; fi \ && apt-get install --yes --quiet --no-install-recommends \ libstdc++-${GCC_MAJOR}-dev \ && apt-get --yes autoremove \