Skip to content

add GitHub action for macOS arm64 #30

add GitHub action for macOS arm64

add GitHub action for macOS arm64 #30

Workflow file for this run

name: FaucK
env:
FAUCK_VERSION: 0.0.3
CMAKE_OSX_DEPLOYMENT_TARGET: 12.0
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
pull_request: {}
push:
branches:
- main
jobs:
build-all-platforms:
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-x86_64
os: ubuntu-20.04
LIBFAUST_DIR: thirdparty/libfaust/ubuntu-x86_64/Release
CMAKE_OSX_ARCHITECTURES: "x86_64"
- name: macos-x86_64
os: macos-12
LIBFAUST_DIR: thirdparty/libfaust/darwin-x64/Release
CMAKE_OSX_ARCHITECTURES: "x86_64"
- name: macos-arm64
os: macos-12
LIBFAUST_DIR: thirdparty/libfaust/darwin-arm64/Release
CMAKE_OSX_ARCHITECTURES: "arm64"
- name: win64
os: windows-2022
LIBFAUST_DIR: thirdparty/libfaust/win64/Release
CMAKE_OSX_ARCHITECTURES: "x86_64"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt install autoconf autogen automake build-essential libasound2-dev \
libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
libmpg123-dev pkg-config python
- name: Brew install requirements (arm64)
if: ${{ endsWith( matrix.name, 'macos-arm64') }}
run: |
brew update
PACKAGES=(flac libogg libtool libvorbis opus mpg123 lame)
DEPS=($(brew deps --union --topological $(echo $PACKAGES) | tr '\n' ' '))
PACKAGES=("${DEPS[@]}" "${PACKAGES[@]}")
export HOMEBREW_NO_INSTALL_CLEANUP=1
export HOMEBREW_NO_INSTALL_UPGRADE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
for PACKAGE in "${PACKAGES[@]}"
do
echo "Fetching bottle: $PACKAGE"
response=$(brew fetch --bottle-tag=arm64_monterey $PACKAGE 2>&1)
package_path=$(echo $response | sed -n 's/.*\:\ \(.*\.tar\.gz\).*/\1/p')
package_path=$(echo "$package_path" | xargs)
echo "Package Path: $package_path"
brew reinstall --verbose --force-bottle "$package_path" || true
done
brew uninstall --ignore-dependencies curl git || true
- name: Install dependencies macOS
if: ${{ endsWith( matrix.name, 'macos-x86_64') }}
run: |
brew install autoconf autogen automake flac libogg libtool libvorbis opus mpg123 pkg-config
- name: Install dependencies Windows
if: startsWith(matrix.os, 'windows')
run: |
cd thirdparty
curl -OL https://github.com/libsndfile/libsndfile/releases/download/1.2.0/libsndfile-1.2.0-win64.zip
7z x libsndfile-1.2.0-win64.zip -y
rm libsndfile-1.2.0-win64.zip
- name: Download Libfaust Windows
if: startsWith(matrix.os, 'windows')
shell: cmd
run: |
cd thirdparty/libfaust
call download_libfaust.bat
- name: Download Libfaust macOS/Linux
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
run: |
cd thirdparty/libfaust && sh download_libfaust.sh
- name: Build Libsndfile
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
run: |
cd thirdparty/libsndfile
cmake -Bbuild -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_OSX_ARCHITECTURES=${{ matrix.CMAKE_OSX_ARCHITECTURES }} -DCMAKE_OSX_DEPLOYMENT_TARGET=$CMAKE_OSX_DEPLOYMENT_TARGET -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX="./install"
cmake --build build --config Release
cmake --build build --target install
- name: Build FaucK Release
run: |
cmake -Bbuild -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_OSX_ARCHITECTURES=${{ matrix.CMAKE_OSX_ARCHITECTURES }} -DCMAKE_OSX_DEPLOYMENT_TARGET=$CMAKE_OSX_DEPLOYMENT_TARGET -DLIBFAUST_DIR=${{ github.workspace }}/${{ matrix.LIBFAUST_DIR }}
cmake --build build --config Release
cmake --build build --config Release --target install
- uses: actions/upload-artifact@v4
with:
name: fauck-${{ matrix.name }}.zip
path: "package/fauck-${{ env.FAUCK_VERSION }}"
if-no-files-found: error