Skip to content

Try a mac build

Try a mac build #20

Workflow file for this run

name: Build
on: [ push ]
jobs:
build:
name: Build ${{ matrix.os }} ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux/amd64
# - os: ubuntu-latest
# platform: linux/arm64
- os: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.platform == 'linux/arm64'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-buildx-action@v3
- name: Build cross-compilation environment
if: matrix.os == 'ubuntu-latest'
uses: docker/build-push-action@v4
with:
context: .
tags: builder/${{ matrix.platform }}:latest
platforms: ${{ matrix.platform }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
- name: Build with Docker
if: matrix.os == 'ubuntu-latest'
uses: addnab/docker-run-action@v3
with:
image: builder/${{ matrix.platform }}:latest
options: |
--platform ${{ matrix.platform }}
--volume ${{ github.workspace }}:/workspace
--workdir /workspace
run: |
cmake -S rapidyenc -B rapidyenc/build \
-D CMAKE_BUILD_TYPE=Release
cmake --build rapidyenc/build --target rapidyenc_static -j$(sysctl -n hw.ncpu)
- name: Build native
if: matrix.os == 'macos-latest'
run: |
cmake -S rapidyenc -B rapidyenc/build \
-D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-D CMAKE_BUILD_TYPE=Release
cmake --build rapidyenc/build --target rapidyenc_static -j$(sysctl -n hw.ncpu)