fix? build-windows

This commit is contained in:
Agel committed 2026-05-24 08:41:21 +02:00
1 parent fd751d6111
commit bb18197228
6 files changed
+58 -30

No files matched your search

+22 -13
View File
@@ -1,18 +1,22 @@
#!/bin/bash
# Run CI build/package jobs locally using podman or docker.
# Usage: test-ci-local.sh [--linux]
# --linux also run build-linux + package-linux in addition to Windows jobs
# Usage: test-ci-windows.sh [--build-image] [--linux]
# --build-image build the CI image from Dockerfile instead of pulling the prebuilt one
# --linux also run build-linux + package-linux in addition to Windows jobs
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
OUTPUT_DIR="$PROJECT_DIR/ci-output"
DOCKERFILE="$PROJECT_DIR/docker/Dockerfile.build"
IMAGE_TAG="asteria-qt-ci-local:latest"
PREBUILT_IMAGE="registry.gitlab.com/asteria-bookreader/asteria-qt/build-env:latest"
IMAGE_TAG="$PREBUILT_IMAGE"
BUILD_IMAGE=false
RUN_LINUX=false
for arg in "$@"; do
case "$arg" in
--build-image) BUILD_IMAGE=true; IMAGE_TAG="asteria-qt-ci-local:latest" ;;
--linux) RUN_LINUX=true ;;
*) echo "Unknown argument: $arg"; exit 1 ;;
esac
@@ -29,14 +33,18 @@ else
fi
echo "Using container runtime: $RUNTIME"
# Build CI image
echo "==> Building CI image from $DOCKERFILE"
"$RUNTIME" build \
--platform linux/amd64 \
--build-arg QT_VERSION=6.10.3 \
-t "$IMAGE_TAG" \
-f "$DOCKERFILE" \
"$PROJECT_DIR"
if [ "$BUILD_IMAGE" = true ]; then
echo "==> Building CI image from $DOCKERFILE"
"$RUNTIME" build \
--platform linux/amd64 \
--build-arg QT_VERSION=6.10.3 \
-t "$IMAGE_TAG" \
-f "$DOCKERFILE" \
"$PROJECT_DIR"
else
echo "==> Pulling prebuilt CI image: $IMAGE_TAG"
"$RUNTIME" pull --platform linux/amd64 "$IMAGE_TAG"
fi
rm -rf "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"
@@ -47,10 +55,11 @@ run_in_container() {
local extra_args=("$@")
"$RUNTIME" run --rm \
--platform linux/amd64 \
--entrypoint bash \
-v "$PROJECT_DIR:/src-ro:ro" \
"${extra_args[@]}" \
"$IMAGE_TAG" \
bash -c '
-c '
set -euo pipefail
cp -r /src-ro /src
cd /src
@@ -63,7 +72,7 @@ echo "==> build-windows"
CI_SCRIPT='
PKG_CONFIG_PATH="${MINGW_SYSROOT}/lib/pkgconfig" cmake -B build-windows -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/opt/mingw-w64-toolchain.cmake \
-DCMAKE_TOOLCHAIN_FILE=/src/scripts/mingw-w64-toolchain.cmake \
-DCMAKE_PREFIX_PATH="${QT_WINDOWS_DIR};${MINGW_SYSROOT}" \
-DCMAKE_FIND_ROOT_PATH="${QT_WINDOWS_DIR};${MINGW_SYSROOT}" \
-DQT_HOST_PATH="${QT_LINUX_DIR}"