Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autobuild: Add macOS M1 (arm64) build target #2682

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -60,7 +62,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[@]}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't read the code further, but would it be possible to pass the arch by normal arguments, not environment variables to stay consistent?

}

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