From 446a6de76eaa7247de4942a5b1046d00bbe31412 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:57:28 +0200 Subject: [PATCH] Upgrade macOS build to macOS 14 * This will also build on arm runners * Switches build directory to more standard location on Apple silicon macs * Updates to use virtual environment for python as per https://docs.brew.sh/Python-for-Formula-Authors#python-declarations-for-applications --- .github/autobuild/mac.sh | 16 ++++++++++++++-- .github/workflows/autobuild.yml | 8 ++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/autobuild/mac.sh b/.github/autobuild/mac.sh index 13cd8d63be..0b5d5456c1 100755 --- a/.github/autobuild/mac.sh +++ b/.github/autobuild/mac.sh @@ -26,7 +26,7 @@ set -eu -QT_DIR=/usr/local/opt/qt +QT_DIR=/opt/qt # The following version pinnings are semi-automatically checked for # updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually: AQTINSTALL_VERSION=3.1.15 @@ -47,7 +47,15 @@ setup() { echo "Using Qt installation from previous run (actions/cache)" else echo "Installing Qt..." - python3 -m pip install "aqtinstall==${AQTINSTALL_VERSION}" + # We may need to create the Qt installation directory and chown it to the runner user to fix permissions + sudo mkdir "${QT_DIR}" + sudo chown "$(whoami)" "${QT_DIR}" + # Create and enter virtual environment + python3 -m venv venv + # Must hide directory as it just gets created during execution of the previous command and cannot be found by shellcheck + # shellcheck source=/dev/null + source venv/bin/activate + pip install "aqtinstall==${AQTINSTALL_VERSION}" local qtmultimedia=() if [[ ! "${QT_VERSION}" =~ 5\.[0-9]+\.[0-9]+ ]]; then # From Qt6 onwards, qtmultimedia is a module and cannot be installed @@ -56,6 +64,9 @@ setup() { fi qtmultimedia+=("qtmultimedia") python3 -m aqt install-qt --outputdir "${QT_DIR}" mac desktop "${QT_VERSION}" --archives qtbase qttools qttranslations "${qtmultimedia[@]}" + # deactivate and remove venv as aqt is no longer needed from here on + deactivate + rm -rf venv fi } @@ -152,3 +163,4 @@ case "${1:-}" in exit 1 ;; esac + diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index b839360822..605b16b3c7 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -226,12 +226,12 @@ jobs: - config_name: MacOS (artifacts) target_os: macos - building_on_os: macos-12 + building_on_os: macos-14 base_command: QT_VERSION=6.6.3 SIGN_IF_POSSIBLE=1 TARGET_ARCHS="x86_64 arm64" ./.github/autobuild/mac.sh # Disable CodeQL on mac as it interferes with signing the binaries (signing hangs, see #2563 and #2564) run_codeql: false - # Default Xcode which runs on macos-12: - xcode_version: 14.2.0 + # Latest Xcode which runs on macos-14: + xcode_version: 15.4.0 is_main_build_target: true # Reminder: If Legacy is removed, be sure to add a dedicated job for CodeQL again. @@ -323,7 +323,7 @@ jobs: uses: actions/cache@v4 with: path: | - /usr/local/opt/qt + /opt/qt ~/Library/Cache/jamulus-homebrew-bottles key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/mac.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.base_command }}