Skip to content

Commit

Permalink
Upgrade macOS build to macOS 14
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ann0see committed Jun 21, 2024
1 parent f965518 commit 446a6de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 14 additions & 2 deletions .github/autobuild/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
}

Expand Down Expand Up @@ -152,3 +163,4 @@ case "${1:-}" in
exit 1
;;
esac

8 changes: 4 additions & 4 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 }}

Expand Down

0 comments on commit 446a6de

Please sign in to comment.