Skip to content

[ci] Simplify the macOS build #985

[ci] Simplify the macOS build

[ci] Simplify the macOS build #985

Workflow file for this run

name: macOS
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'htdocs/**'
- 'web-src/**'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- 'htdocs/**'
- 'web-src/**'
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
brew update
brew install \
autoconf \
automake \
libtool
- name: Install libinotify-kqueue
# brew does not have libinotify package
run: |
git clone https://github.com/libinotify-kqueue/libinotify-kqueue
cd libinotify-kqueue
autoreconf -fi
./configure
make
sudo make install
cd ..
- name: Install other dependencies
run: |
brew install \
bison \
confuse \
ffmpeg \
flex \
libplist \
libwebsockets \
json-c \
protobuf-c \
pulseaudio
- name: Configure
# We configure a non-privileged setup, since how to add a "owntone" system
# user in macOS isn't clear to me (useradd etc. isn't available)
run: |
sudo ln -s "$(brew --prefix)/opt/bison/bin/bison" /usr/local/bin/bison
sudo ln -s "$(brew --prefix)/opt/flex/bin/flex" /usr/local/bin/flex
export CFLAGS="-I$(brew --prefix)/include -I$(brew --prefix sqlite)/include"
export LDFLAGS="-L$(brew --prefix)/lib -L$(brew --prefix sqlite)/lib"
autoreconf -fi
./configure --prefix=$HOME/owntone_data/usr --sysconfdir=$HOME/owntone_data/etc --localstatedir=$HOME/owntone_data/var --enable-chromecast --with-pulseaudio
- name: Build
run: |
make
- name: Install
run: |
make install
- name: Prepare test run
run: |
mkdir -p $HOME/owntone_data/media
sed -i '' 's/uid = "owntone"/uid = ${USER}/g' $HOME/owntone_data/etc/owntone.conf
sed -i '' 's/loglevel = log/loglevel = debug/g' $HOME/owntone_data/etc/owntone.conf
sed -i '' 's/directories = { "\/srv\/music" }/directories = { "${HOME}\/owntone_data\/media" }/g' $HOME/owntone_data/etc/owntone.conf
- name: Test run
run: |
$HOME/owntone_data/usr/sbin/owntone -f -t