move resolution to separate script

This commit is contained in:
Bruno Alexandre Rosa 2025-12-31 16:44:12 -03:00
parent d14747430c
commit 904b22395b
2 changed files with 28 additions and 16 deletions

View file

@ -0,0 +1,27 @@
#!/bin/bash
# We cache thinned versions of universal ("fat") Qt binaries to reduce the size of the packages and caches.
# The universal binaries are install via aqtinstall. We use wildcards to get the latest patch version. E.g. "6.6.*" -> "6.6.3".
# This script is used to resolve the latest patch version of Qt.
# This script is meant to be used by the ci enironment on macos runners only.
# It uses the runner's GITHUB_OUTPUT env variable.
# Usage example: .ci/resolve_latest_aqt_qt_version.sh "6.6.*"
QT_SPEC=$1
# If version is already specific (no wildcard), use it as-is
if [[ "$QT_SPEC" != *"*" ]]; then
echo "version=$QT_SPEC" >> "$GITHUB_OUTPUT"
exit 0
fi
# Resolve latest patch
QT_RESOLVED=$(aqt list-qt mac desktop --spec "$QT_SPEC" --latest-version)
echo "QT_RESOLVED=$QT_RESOLVED"
if [ -z "$QT_RESOLVED" ]; then
echo "Error: Could not resolve Qt version for $QT_SPEC"
exit 1
fi
echo "version=$QT_RESOLVED" >> "$GITHUB_OUTPUT"

View file

@ -380,22 +380,7 @@ jobs:
id: resolve_qt_version
shell: bash
# Ouputs the version of Qt to install via aqtinstall
run: |
# If version is already specific (no wildcard), use it as-is
if [[ "${{matrix.qt_version}}" != *"*" ]]; then
echo "version=${{matrix.qt_version}}" >> "$GITHUB_OUTPUT"
exit 0
fi
# Resolve latest patch
QT_RESOLVED=$(aqt list-qt mac desktop --spec "${{matrix.qt_version}}" --latest-version)
echo "QT_RESOLVED=$QT_RESOLVED"
if [ -z "$QT_RESOLVED" ]; then
echo "Error: Could not resolve Qt version for ${{matrix.qt_version}}"
exit 1
fi
echo "version=$QT_RESOLVED" >> "$GITHUB_OUTPUT"
run: .ci/resolve_latest_aqt_qt_version.sh "${{matrix.qt_version}}"
- name: Restore thin Qt ${{ steps.resolve_qt_version.outputs.version }} libraries (${{ matrix.soc }} macOS)
if: matrix.os == 'macOS'