Skip to content

Commit

Permalink
macos actions
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Jul 30, 2024
1 parent 367b18d commit 22a0d14
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:

jobs:
build:
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch: [x86_64, arm64]
os: [macos-13, macos-14]

steps:
- name: Checkout
Expand All @@ -35,15 +35,15 @@ jobs:
run: echo "CPU_CORES=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
run: cmake -B build -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build build --config Release -- -j${{ env.CPU_CORES }}

- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: macos-${{ matrix.arch }}
name: ${{ matrix.os }}
path: lib/

create-universal-dylibs:
Expand All @@ -53,21 +53,21 @@ jobs:
- name: Download x86_64 Build Artifacts
uses: actions/download-artifact@v3
with:
name: macos-x86_64
path: macos-x86_64
name: macos-13
path: macos-13

- name: Download arm64 Build Artifacts
uses: actions/download-artifact@v3
with:
name: macos-arm64
path: macos-arm64
name: macos-14
path: macos-14

- name: Create Universal dylibs
run: |
mkdir -p universal/lib
for dylib in macos-x86_64/*.dylib; do
for dylib in macos-13/*.dylib; do
dylib_name=$(basename $dylib)
lipo -create macos-x86_64/$dylib_name macos-arm64/$dylib_name -output universal/$dylib_name
lipo -create macos-13/$dylib_name macos-14/$dylib_name -output universal/$dylib_name
done
- name: Upload Universal dylibs
Expand Down

0 comments on commit 22a0d14

Please sign in to comment.