Skip to content

Commit

Permalink
[ci] Add M1 homebrew builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Dec 11, 2023
1 parent 3dde7b0 commit 85a7924
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 3 deletions.
48 changes: 46 additions & 2 deletions .github/workflows/mac-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: push

jobs:
brew:
name: macOS (Brew)
name: macOS (Release, Brew, Intel)
runs-on: macos-13

steps:
Expand All @@ -23,4 +23,48 @@ jobs:
- name: Build
run: |
./ci/osx-brew.build.sh
./ci/osx-brew.build.sh
brew-m1:
name: macOS (Release, Brew, AppleSilicon)
runs-on: macos-13-xlarge

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Dependencies
run: |
./ci/osx-brew.deps.sh
- name: Build
run: |
./ci/osx-brew.build.sh
brew-m1-dev:
name: macOS (Dev, Brew, AppleSilicon)
runs-on: macos-13-xlarge

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Dependencies
run: |
./ci/osx-brew.deps.sh
- name: Build
run: |
./ci/developer.build.sh
35 changes: 35 additions & 0 deletions ci/developer.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash -eux

if [[ $# -lt 1 ]]; then
echo "Pass paths to source and build dir as you would for any CMake script: -S <source dir> -B <build dir>"
exit 1
fi

if [[ -x "$(command -v ld.mold)" ]]; then
LINKER=" -fuse-ld=mold -Wl,-z,now "
elif [[ -x "$(command -v ld.lld)" ]]; then
LINKER=" -fuse-ld=lld -Wl,-z,now "
else
LINKER=""
fi

ARGS=(
-GNinja
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_FLAGS="-Wall -Wextra -pedantic -Woverloaded-virtual -Werror=return-type"
-DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Woverloaded-virtual -Werror=return-type"
-DCMAKE_EXE_LINKER_FLAGS=" $LINKER "
-DCMAKE_SHARED_LINKER_FLAGS=" $LINKER "
-DCMAKE_MODULE_LINKER_FLAGS=" $LINKER "
-DCMAKE_OPTIMIZE_DEPENDENCIES=1
-DCMAKE_LINK_DEPENDS_NO_SHARED=1
-DSCORE_PCH=1
-DSCORE_DYNAMIC_PLUGINS=1
-DCMAKE_POSITION_INDEPENDENT_CODE=1
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
-DCMAKE_BUILD_TYPE=Debug
)

cmake "$@" "${ARGS[@]}"
cmake --build build-developer
2 changes: 1 addition & 1 deletion ci/osx-package.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ brew install gnu-tar ninja
wget -nv https://github.com/jcelerier/cninja/releases/download/v3.7.9/cninja-v3.7.9-macOS.tar.gz -O cninja.tgz &

SDK_ARCHIVE=sdk-macOS.tar.gz
wget -nv https://github.com/ossia/score-sdk/releases/download/sdk29/$SDK_ARCHIVE -O $SDK_ARCHIVE
wget -nv https://github.com/ossia/score-sdk/releases/download/sdk30/$SDK_ARCHIVE -O $SDK_ARCHIVE
sudo mkdir -p /opt/ossia-sdk-$MACOS_ARCH/
sudo chown -R $(whoami) /opt
sudo chmod -R a+rwx /opt
Expand Down

0 comments on commit 85a7924

Please sign in to comment.