From 95a79a8802aece0ba1ce0574d11f4b05b42baa65 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sat, 19 Sep 2026 21:59:34 +0200 Subject: [PATCH] Re-add resolve_latest_aqt_qt_version.sh --- .ci/resolve_latest_aqt_qt_version.sh | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 .ci/resolve_latest_aqt_qt_version.sh diff --git a/.ci/resolve_latest_aqt_qt_version.sh b/.ci/resolve_latest_aqt_qt_version.sh new file mode 100755 index 000000000..066140ac9 --- /dev/null +++ b/.ci/resolve_latest_aqt_qt_version.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# This script is used to resolve the latest patch version of Qt using aqtinstall. +# It interprets wildcards to get the latest patch version. E.g. "6.6.*" -> "6.6.3". + +# This script is meant to be used by the ci enironment. +# It uses the runner's GITHUB_OUTPUT env variable. + +# Usage example: .ci/resolve_latest_aqt_qt_version.sh "6.6.*" + +qt_spec=$1 +if [[ ! $qt_spec ]]; then + echo "usage: $0 [version]" + exit 2 +fi + +# If version is already specific (no wildcard), use it as-is +if [[ $qt_spec != *"*" ]]; then + echo "version $qt_spec is already resolved" + echo "version=$qt_spec" >> "$GITHUB_OUTPUT" + exit 0 +fi + +if ! hash aqt; then + echo "aqt could not be found, has aqtinstall been installed?" + exit 2 +fi + +# Resolve latest patch +if [[ $RUNNER_OS == macOS ]]; then + if ! qt_resolved=$(aqt list-qt mac desktop --spec "$qt_spec" --latest-version); then + exit 1 + fi +elif [[ $RUNNER_OS == Windows ]]; then + if ! qt_resolved=$(aqt list-qt windows desktop --spec "$qt_spec" --latest-version); then + exit 1 + fi +else + echo "aqt command for $RUNNER_OS not defined." + exit 1 +fi + +echo "resolved $qt_spec to $qt_resolved" +if [[ ! $qt_resolved ]]; then + echo "Error: Could not resolve Qt version for $qt_spec" + exit 1 +fi + +echo "version=$qt_resolved" >> "$GITHUB_OUTPUT"