moaaar ci changes
This commit is contained in:
7 files changed
+555
-227
No files matched your search
+162
-52
@@ -1,64 +1,63 @@
|
||||
FROM ubuntu:24.04
|
||||
# Multi-stage CI runner images for asteria-qt (all sharing the `base` layer).
|
||||
# Targets:
|
||||
# - linux-x86_64 : Native Linux x86_64 build, CTest, AppImage packaging, and wiki jobs
|
||||
# - linux-arm64 : Cross-compiled Linux ARM64 build and AppImage packaging
|
||||
# - windows-x86_64 : Cross-compiled Windows x86_64 build and portable zip packaging
|
||||
# - windows-arm64 : Cross-compiled Windows ARM64 build and portable zip packaging
|
||||
|
||||
FROM ubuntu:24.04 AS base
|
||||
|
||||
ARG QT_VERSION=6.12.0
|
||||
ARG QT_INSTALL_DIR=/opt/qt
|
||||
ARG LLVM_MINGW_VERSION=20240917
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV QT_VERSION=${QT_VERSION}
|
||||
ENV QT_INSTALL_DIR=${QT_INSTALL_DIR}
|
||||
ENV QT_LINUX_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/gcc_64
|
||||
ENV QT_LINUX_ARM64_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/gcc_arm64
|
||||
ENV QT_WINDOWS_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/mingw_64
|
||||
ENV QT_WINDOWS_ARM64_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/mingw_arm64
|
||||
ENV MINGW_SYSROOT=${QT_WINDOWS_DIR}
|
||||
ENV MINGW_ARM64_SYSROOT=${QT_WINDOWS_ARM64_DIR}
|
||||
|
||||
# ── Linux x86_64 & ARM64 dependencies + Qt 6 (via install-deps-ubuntu.sh) ──────
|
||||
COPY scripts/install-deps-ubuntu.sh /tmp/install-deps-ubuntu.sh
|
||||
RUN chmod +x /tmp/install-deps-ubuntu.sh && \
|
||||
QT_VERSION=${QT_VERSION} QT_INSTALL_DIR=${QT_INSTALL_DIR} /tmp/install-deps-ubuntu.sh --with-arm64 && \
|
||||
rm -rf /tmp/install-deps-ubuntu.sh /var/lib/apt/lists/*
|
||||
|
||||
# ── llvm-mingw cross-compiler (targets both x86_64-w64-mingw32 & aarch64-w64-mingw32) ──
|
||||
RUN wget -q https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-ubuntu-20.04-x86_64.tar.xz \
|
||||
-O /tmp/llvm-mingw.tar.xz && \
|
||||
tar -xf /tmp/llvm-mingw.tar.xz -C /opt && \
|
||||
mv /opt/llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-ubuntu-20.04-x86_64 /opt/llvm-mingw && \
|
||||
rm /tmp/llvm-mingw.tar.xz
|
||||
|
||||
ENV PATH="/opt/llvm-mingw/bin:${PATH}"
|
||||
|
||||
# ── Windows x86_64 & ARM64 prebuilt MSYS2 sysroots (Qt 6 + third-party libs) ───
|
||||
COPY scripts/download-mingw-arm64-qt.py /tmp/download-mingw-arm64-qt.py
|
||||
RUN chmod +x /tmp/download-mingw-arm64-qt.py && \
|
||||
python3 /tmp/download-mingw-arm64-qt.py --arch x86_64 --dest "${QT_WINDOWS_DIR}" && \
|
||||
python3 /tmp/download-mingw-arm64-qt.py --arch arm64 --dest "${QT_WINDOWS_ARM64_DIR}" && \
|
||||
ln -sfn "${QT_WINDOWS_DIR}" /opt/mingw-sysroot && \
|
||||
ln -sfn "${QT_WINDOWS_ARM64_DIR}" /opt/mingw-arm64-sysroot && \
|
||||
rm /tmp/download-mingw-arm64-qt.py
|
||||
|
||||
# ── CMake cross-compilation toolchain files ────────────────────────────────────
|
||||
COPY scripts/mingw-w64-toolchain.cmake /opt/mingw-w64-toolchain.cmake
|
||||
COPY scripts/mingw-w64-arm64-toolchain.cmake /opt/mingw-w64-arm64-toolchain.cmake
|
||||
COPY scripts/linux-arm64-toolchain.cmake /opt/linux-arm64-toolchain.cmake
|
||||
|
||||
# ── appimagetool & static AppImage runtimes (x86_64 & aarch64) ─────────────────
|
||||
# Note: Zeroing AppImage magic bytes 8-10 allows extraction under both native Linux and Rosetta 2
|
||||
RUN mkdir -p /opt/appimage && \
|
||||
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage \
|
||||
-O /tmp/appimagetool && \
|
||||
chmod +x /tmp/appimagetool && \
|
||||
printf '\000\000\000' | dd of=/tmp/appimagetool bs=1 seek=8 count=3 conv=notrunc && \
|
||||
cd /tmp && /tmp/appimagetool --appimage-extract && \
|
||||
mv squashfs-root /opt/appimagetool && \
|
||||
ln -sf /opt/appimagetool/AppRun /usr/local/bin/appimagetool && \
|
||||
rm /tmp/appimagetool && \
|
||||
wget -q https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64 \
|
||||
-O /opt/appimage/runtime-x86_64 && \
|
||||
wget -q https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-aarch64 \
|
||||
-O /opt/appimage/runtime-aarch64 && \
|
||||
chmod +x /opt/appimage/runtime-x86_64 /opt/appimage/runtime-aarch64
|
||||
# ── Core CLI tools, Qt host runtime libs, and host Qt 6 (QT_HOST_PATH) ─────────
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
curl \
|
||||
file \
|
||||
git \
|
||||
jq \
|
||||
libdbus-1-3 \
|
||||
libegl1 \
|
||||
libfontconfig1 \
|
||||
libfreetype6 \
|
||||
libgl1 \
|
||||
libglib2.0-0t64 \
|
||||
libxkbcommon0 \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-venv \
|
||||
wget \
|
||||
xz-utils \
|
||||
zip \
|
||||
zstd \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& python3 -m venv /tmp/aqt-venv \
|
||||
&& /tmp/aqt-venv/bin/pip install --quiet aqtinstall \
|
||||
&& /tmp/aqt-venv/bin/aqt install-qt linux desktop "${QT_VERSION}" linux_gcc_64 \
|
||||
-m qtimageformats --outputdir "${QT_INSTALL_DIR}" \
|
||||
&& rm -rf /tmp/aqt-venv \
|
||||
&& rm -rf \
|
||||
"${QT_LINUX_DIR}/doc" \
|
||||
"${QT_LINUX_DIR}/examples" \
|
||||
"${QT_LINUX_DIR}/phrasebooks" \
|
||||
"${QT_LINUX_DIR}/translations" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/LocalStorage" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/Particles" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/Pdf" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/Scene2D" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/Scene3D" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/Timeline" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/VirtualKeyboard" \
|
||||
"${QT_LINUX_DIR}/qml/QtQuick/tooling"
|
||||
|
||||
# ── gitlab-runner (shell executor) ─────────────────────────────────────────────
|
||||
RUN wget -q https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 \
|
||||
@@ -72,3 +71,114 @@ RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD []
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Shared Linux packaging layer (patchelf + binutils/readelf + appimagetool)
|
||||
# ==============================================================================
|
||||
FROM base AS linux-base
|
||||
|
||||
# Note: Zeroing AppImage magic bytes 8-10 allows extraction under both native Linux and Rosetta 2
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -y --no-install-recommends binutils patchelf && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
mkdir -p /opt/appimage && \
|
||||
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage \
|
||||
-O /tmp/appimagetool && \
|
||||
chmod +x /tmp/appimagetool && \
|
||||
printf '\000\000\000' | dd of=/tmp/appimagetool bs=1 seek=8 count=3 conv=notrunc && \
|
||||
cd /tmp && /tmp/appimagetool --appimage-extract && \
|
||||
mv squashfs-root /opt/appimagetool && \
|
||||
ln -sf /opt/appimagetool/AppRun /usr/local/bin/appimagetool && \
|
||||
rm /tmp/appimagetool
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Target 1: Linux x86_64 (native build, CTest, AppImage, wiki)
|
||||
# ==============================================================================
|
||||
FROM linux-base AS linux-x86_64
|
||||
|
||||
COPY scripts/install-deps-ubuntu.sh /tmp/install-deps-ubuntu.sh
|
||||
RUN chmod +x /tmp/install-deps-ubuntu.sh && \
|
||||
QT_VERSION=${QT_VERSION} QT_INSTALL_DIR=${QT_INSTALL_DIR} \
|
||||
/tmp/install-deps-ubuntu.sh --skip-qt && \
|
||||
rm -rf /tmp/install-deps-ubuntu.sh /var/lib/apt/lists/* && \
|
||||
wget -q https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64 \
|
||||
-O /opt/appimage/runtime-x86_64 && \
|
||||
chmod +x /opt/appimage/runtime-x86_64 && \
|
||||
g++ --version
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Target 2: Linux ARM64 (aarch64 cross-compile + AppImage)
|
||||
# ==============================================================================
|
||||
FROM linux-base AS linux-arm64
|
||||
|
||||
ENV QT_LINUX_ARM64_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/gcc_arm64
|
||||
|
||||
COPY scripts/install-deps-ubuntu.sh /tmp/install-deps-ubuntu.sh
|
||||
RUN chmod +x /tmp/install-deps-ubuntu.sh && \
|
||||
QT_VERSION=${QT_VERSION} QT_INSTALL_DIR=${QT_INSTALL_DIR} \
|
||||
/tmp/install-deps-ubuntu.sh --only-arm64 --prune-qt && \
|
||||
rm -rf /tmp/install-deps-ubuntu.sh /var/lib/apt/lists/* && \
|
||||
wget -q https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-aarch64 \
|
||||
-O /opt/appimage/runtime-aarch64 && \
|
||||
chmod +x /opt/appimage/runtime-aarch64
|
||||
|
||||
COPY scripts/linux-arm64-toolchain.cmake /opt/linux-arm64-toolchain.cmake
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Shared Windows cross-compilation base (llvm-mingw pruned to 64-bit targets)
|
||||
# ==============================================================================
|
||||
FROM base AS windows-base
|
||||
|
||||
ARG LLVM_MINGW_VERSION=20240917
|
||||
|
||||
RUN wget -q https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-ubuntu-20.04-x86_64.tar.xz \
|
||||
-O /tmp/llvm-mingw.tar.xz && \
|
||||
tar -xf /tmp/llvm-mingw.tar.xz -C /opt && \
|
||||
mv /opt/llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-ubuntu-20.04-x86_64 /opt/llvm-mingw && \
|
||||
rm -rf /tmp/llvm-mingw.tar.xz \
|
||||
/opt/llvm-mingw/i686-w64-mingw32 \
|
||||
/opt/llvm-mingw/armv7-w64-mingw32 \
|
||||
/opt/llvm-mingw/bin/i686-* \
|
||||
/opt/llvm-mingw/bin/armv7-*
|
||||
|
||||
ENV PATH="/opt/llvm-mingw/bin:${PATH}"
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Target 3: Windows x86_64 (LLVM-MinGW + MSYS2 clang64 Qt 6)
|
||||
# ==============================================================================
|
||||
FROM windows-base AS windows-x86_64
|
||||
|
||||
ENV QT_WINDOWS_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/mingw_64
|
||||
ENV MINGW_SYSROOT=${QT_WINDOWS_DIR}
|
||||
|
||||
COPY scripts/download-mingw-arm64-qt.py /tmp/download-mingw-arm64-qt.py
|
||||
RUN chmod +x /tmp/download-mingw-arm64-qt.py && \
|
||||
python3 /tmp/download-mingw-arm64-qt.py --arch x86_64 --dest "${QT_WINDOWS_DIR}" && \
|
||||
ln -sfn "${QT_WINDOWS_DIR}" /opt/mingw-sysroot && \
|
||||
rm /tmp/download-mingw-arm64-qt.py && \
|
||||
x86_64-w64-mingw32-g++ --version
|
||||
|
||||
COPY scripts/mingw-w64-toolchain.cmake /opt/mingw-w64-toolchain.cmake
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Target 4: Windows ARM64 (LLVM-MinGW + MSYS2 clangarm64 Qt 6)
|
||||
# ==============================================================================
|
||||
FROM windows-base AS windows-arm64
|
||||
|
||||
ENV QT_WINDOWS_ARM64_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/mingw_arm64
|
||||
ENV MINGW_ARM64_SYSROOT=${QT_WINDOWS_ARM64_DIR}
|
||||
|
||||
COPY scripts/download-mingw-arm64-qt.py /tmp/download-mingw-arm64-qt.py
|
||||
RUN chmod +x /tmp/download-mingw-arm64-qt.py && \
|
||||
python3 /tmp/download-mingw-arm64-qt.py --arch arm64 --dest "${QT_WINDOWS_ARM64_DIR}" && \
|
||||
ln -sfn "${QT_WINDOWS_ARM64_DIR}" /opt/mingw-arm64-sysroot && \
|
||||
rm /tmp/download-mingw-arm64-qt.py && \
|
||||
aarch64-w64-mingw32-g++ --version
|
||||
|
||||
COPY scripts/mingw-w64-arm64-toolchain.cmake /opt/mingw-w64-arm64-toolchain.cmake
|
||||
Reference in new issue
Block a user