Skip to content

Commit

Permalink
Merge pull request #2682 from hoffie/autobuild/add-mac-arm64e
Browse files Browse the repository at this point in the history
Autobuild: Add macOS M1 (arm64) build target
  • Loading branch information
pljones authored Jul 6, 2022
2 parents 6744342 + 1331b11 commit 514f78f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/autobuild/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -eu
QT_DIR=/usr/local/opt/qt
AQTINSTALL_VERSION=2.1.0

TARGET_ARCH="${TARGET_ARCH:-}"

if [[ ! ${QT_VERSION:-} =~ [0-9]+\.[0-9]+\..* ]]; then
echo "Environment variable QT_VERSION must be set to a valid Qt version"
exit 1
Expand Down Expand Up @@ -67,7 +69,7 @@ build_app_as_dmg_installer() {
if prepare_signing; then
BUILD_ARGS=("-s" "${MACOS_CERTIFICATE_ID}")
fi
./mac/deploy_mac.sh "${BUILD_ARGS[@]}"
TARGET_ARCH="${TARGET_ARCH}" ./mac/deploy_mac.sh "${BUILD_ARGS[@]}"
}

pass_artifact_to_job() {
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ jobs:
# Latest Xcode which runs on macos-11:
xcode_version: 13.4.1

- config_name: MacOS arm64 (artifacts)
target_os: macos
building_on_os: macos-12
base_command: QT_VERSION=6.3.1 SIGN_IF_POSSIBLE=1 TARGET_ARCH=arm64 ARTIFACT_SUFFIX=_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
xcode_version: 13.4.1

# Reminder: If Legacy is removed, be sure to add a dedicated job for CodeQL again.
- config_name: MacOS Legacy (artifacts+CodeQL)
target_os: macos
Expand Down
6 changes: 5 additions & 1 deletion mac/deploy_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ build_app() {
local client_or_server="${1}"

# Build Jamulus
qmake "${project_path}" -o "${build_path}/Makefile" "CONFIG+=release" "${@:2}"
declare -a BUILD_ARGS=("_UNUSED_DUMMY=''") # old bash fails otherwise
if [[ "${TARGET_ARCH:-}" ]]; then
BUILD_ARGS=("QMAKE_APPLE_DEVICE_ARCHS=${TARGET_ARCH}" "QT_ARCH=${TARGET_ARCH}")
fi
qmake "${project_path}" -o "${build_path}/Makefile" "CONFIG+=release" "${BUILD_ARGS[@]}" "${@:2}"
local target_name
target_name=$(sed -nE 's/^QMAKE_TARGET *= *(.*)$/\1/p' "${build_path}/Makefile")
local job_count
Expand Down

0 comments on commit 514f78f

Please sign in to comment.