Skip to content

workflow 3

workflow 3 #4

Workflow file for this run

name: Build MacOS
on:
push:
branches:
- main
paths:
- '.github/workflows/build-macos.yml'
- 'src/**'
- 'include/**'
- 'example/**'
- 'CMakeLists.txt'
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Update CMake
run: brew install cmake
- name: Download ONNX Runtime
run: |
if [ "${{ matrix.arch }}" == "x86_64" ]; then
wget https://github.com/microsoft/onnxruntime/releases/download/v1.18.1/onnxruntime-osx-x86_64-1.18.1.tgz -O onnxruntime.tgz
else
wget https://github.com/microsoft/onnxruntime/releases/download/v1.18.1/onnxruntime-osx-arm64-1.18.1.tgz -O onnxruntime.tgz
fi
mkdir -p onnxruntime
tar -xzf onnxruntime.tgz -C onnxruntime --strip-components 1
mkdir -p lib
rsync -a onnxruntime/lib/ lib/
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DONNXRUNTIME_DIR=${PWD}/onnxruntime
- name: Build
run: cmake --build build --config Release