Rewrite macOS builds as Github actions

Cirrus-CI is about to shut down on June 1st 2026. Thus turn the macOS
build jobs into github actions so we can continue testing on macOS.
This commit is contained in:
Thomas Huth committed 2026-04-18 20:20:12 +02:00
1 parent 62db9c4fe6
commit 29aeb4e77e
4 files changed
+158 -77

No files matched your search

+2 -77
View File
@@ -16,92 +16,17 @@ freebsd_task:
xcode_task:
osx_instance:
image: ghcr.io/cirruslabs/macos-runner:sonoma
env:
SDLVERSION: 2.26.5
PNGVERSION: 1.6.48
download_cache:
folder: dl_cache
populate_script:
- if [ ! -d dl_cache ]; then mkdir dl_cache ; fi
install_script:
# Download and install precompiled SDL2 Framework
- if [ ! -f dl_cache/SDL2-$SDLVERSION.dmg ]; then
wget -O dl_cache/SDL2-$SDLVERSION.dmg
https://github.com/libsdl-org/SDL/releases/download/release-$SDLVERSION/SDL2-$SDLVERSION.dmg ;
fi
- hdiutil attach dl_cache/SDL2-$SDLVERSION.dmg
- sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/
# Download, compile and install libpng Framework
- if [ ! -e dl_cache/png.framework ]; then
wget -O dl_cache/libpng-$PNGVERSION.tar.xz
"http://prdownloads.sourceforge.net/libpng/libpng-$PNGVERSION.tar.xz?download" ;
tar -xJf dl_cache/libpng-$PNGVERSION.tar.xz ;
cd libpng-$PNGVERSION ;
cmake -DPNG_FRAMEWORK=ON -DPNG_HARDWARE_OPTIMIZATIONS=OFF
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="10.13"
-DCMAKE_OSX_ARCHITECTURES:STRING="arm64;x86_64" . ;
cmake --build . --verbose --config Release -j$(sysctl -n hw.ncpu) ;
codesign --force -s - png.framework ;
cd .. ;
mv libpng-$PNGVERSION/png.framework dl_cache/ ;
rm -rf libpng-$PNGVERSION ;
fi
- sudo cp -a dl_cache/png.framework /Library/Frameworks/
# Download and install precompiled portmidi Framework
- if [ ! -e dl_cache/portmidi.framework ]; then
cd dl_cache ;
wget "https://hatari.frama.io/ci-files/macos/portmidi.framework.zip" ;
unzip portmidi.framework.zip ;
mv license.txt portmidi-license.txt ;
cd .. ;
fi
- sudo cp -a dl_cache/portmidi.framework /Library/Frameworks/
# Download and install precompiled capsimage Framework
- if [ ! -e dl_cache/capsimage_5.1_macos-x86_64-arm64 ]; then
cd dl_cache ;
wget "https://hatari.frama.io/ci-files/macos/capsimage_5.1_macos-x86_64-arm64_selfsigned.zip" ;
unzip capsimage_5.1_macos-x86_64-arm64_selfsigned.zip ;
cd capsimage_5.1_macos-x86_64-arm64 ;
mv LICENCE.txt DONATIONS.txt README.txt HISTORY.txt CAPSImage.framework ;
cd ../.. ;
fi
- sudo cp -a dl_cache/capsimage_5.1_macos-x86_64-arm64/CAPSImage.framework /Library/Frameworks/
- ci/macos-setup.sh
script:
- export PATH=/usr/local/bin:$PATH
- mkdir build
- cd build
- cmake -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="10.13"
-DCMAKE_OSX_ARCHITECTURES:STRING="arm64;x86_64" ..
|| { cat config.log; exit 1; }
- cmake --build . --verbose --config Release -j$(sysctl -n hw.ncpu) -t Hatari
- cp -a ../dl_cache/portmidi.framework src/hatari.app/Contents/Frameworks/
- cp -a ../dl_cache/capsimage_5.1_macos-x86_64-arm64/CAPSImage.framework src/hatari.app/Contents/Frameworks/
- codesign --force -s - --entitlements ../src/gui-osx/hatari.app.xcent src/Hatari.app
- cd ..
- mkdir hatari-snapshot
- echo $(git rev-parse HEAD) > hatari-snapshot/version.txt
- date >> hatari-snapshot/version.txt
- cp -a build/src/Hatari.app hatari-snapshot/
- cp -a doc gpl.txt readme.txt hatari-snapshot/
- cp dl_cache/portmidi-license.txt hatari-snapshot/
- zip -r hatari-snapshot.zip hatari-snapshot
- ci/macos-build.sh
hatari_artifacts:
path: "hatari-snapshot.zip"
macos14_task:
osx_instance:
image: ghcr.io/cirruslabs/macos-runner:sonoma
install_script:
- brew update
- brew install sdl2 libpng make tidy-html5 imagemagick capstone
script:
- export PATH=/usr/local/bin:$PATH
- ./configure --disable-osx-bundle --enable-debug
|| { cat config.log; exit 1; }
- gmake -j$(sysctl -n hw.ncpu)
- ctest -j$(sysctl -n hw.ncpu) test
|| { cat Testing/Temporary/LastTest.log; exit 1; }
cygwin_task:
windows_container:
image: cirrusci/windowsservercore:2019
+65
View File
@@ -0,0 +1,65 @@
name: Build Hatari on macOS
on:
push:
branches:
- main
- test
tags:
- v*
jobs:
macos_bundle:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Restore cached libraries
id: cache-libs-restore
uses: actions/cache/restore@v5
with:
path: dl_cache
key: ${{ runner.os }}-libs-${{ github.run_id }}
restore-keys: ${{ runner.os }}-libs-
- name: Prepare libraries
run: |
ci/macos-setup.sh
- name: Save libraries
if: ${{ hashFiles('libs-changed.txt') != '' }}
id: cache-libs-save
uses: actions/cache/save@v5
with:
path: dl_cache
key: ${{ runner.os }}-libs-${{ github.run_id }}
- name: Compile Hatari
run: |
ci/macos-build.sh
- name: Publish artifact
uses: actions/upload-artifact@v7
with:
path: hatari-snapshot.zip
archive: false
macos_cli:
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- name: Install libraries via brew
run: |
brew update
brew install sdl2 libpng make tidy-html5 imagemagick capstone
- name: Install libraries via brew
run: |
export PATH=/usr/local/bin:$PATH
./configure --disable-osx-bundle --enable-debug \
|| { cat config.log; exit 1; }
gmake -j$(sysctl -n hw.ncpu)
ctest -j$(sysctl -n hw.ncpu) test \
|| { cat Testing/Temporary/LastTest.log; exit 1; }
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
set -e
set -x
PATH=/usr/local/bin:$PATH
mkdir build
cd build
# Configure the build and compile it
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="10.13" \
-DCMAKE_OSX_ARCHITECTURES:STRING="arm64;x86_64" .. \
|| { cat config.log; exit 1; }
cmake --build . --verbose --config Release -j$(sysctl -n hw.ncpu) -t Hatari
cp -a ../dl_cache/portmidi.framework src/hatari.app/Contents/Frameworks/
cp -a ../dl_cache/capsimage_5.1_macos-x86_64-arm64/CAPSImage.framework src/hatari.app/Contents/Frameworks/
codesign --force -s - --entitlements ../src/gui-osx/hatari.app.xcent src/Hatari.app
cd ..
# Create a package for the users
mkdir hatari-snapshot
echo $(git rev-parse HEAD) > hatari-snapshot/version.txt
date >> hatari-snapshot/version.txt
cp -a build/src/Hatari.app hatari-snapshot/
cp -a doc gpl.txt readme.txt hatari-snapshot/
cp dl_cache/portmidi-license.txt hatari-snapshot/
zip -r hatari-snapshot.zip hatari-snapshot
+61
View File
@@ -0,0 +1,61 @@
#!/bin/sh
set -e
set -x
SDLVERSION=2.30.11
PNGVERSION=1.6.48
if [ ! -d dl_cache ]; then
mkdir dl_cache
fi
# Download and install precompiled SDL2 Framework
if [ ! -f dl_cache/SDL2-$SDLVERSION.dmg ]; then
wget -O dl_cache/SDL2-$SDLVERSION.dmg \
https://github.com/libsdl-org/SDL/releases/download/release-$SDLVERSION/SDL2-$SDLVERSION.dmg
echo "SDL" > libs-changed.txt
fi
hdiutil attach dl_cache/SDL2-$SDLVERSION.dmg
sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/
# Download, compile and install libpng Framework
if [ ! -e dl_cache/png.framework ]; then
wget -O dl_cache/libpng-$PNGVERSION.tar.xz \
"http://prdownloads.sourceforge.net/libpng/libpng-$PNGVERSION.tar.xz?download" ;
tar -xJf dl_cache/libpng-$PNGVERSION.tar.xz
cd libpng-$PNGVERSION
cmake -DPNG_FRAMEWORK=ON -DPNG_HARDWARE_OPTIMIZATIONS=OFF \
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="10.13" \
-DCMAKE_OSX_ARCHITECTURES:STRING="arm64;x86_64" .
cmake --build . --verbose --config Release -j$(sysctl -n hw.ncpu)
codesign --force -s - png.framework
cd ..
mv libpng-$PNGVERSION/png.framework dl_cache/
rm -rf libpng-$PNGVERSION
echo "png" >> libs-changed.txt
fi
sudo cp -a dl_cache/png.framework /Library/Frameworks/
# Download and install precompiled portmidi Framework
if [ ! -e dl_cache/portmidi.framework ]; then
cd dl_cache
wget "https://hatari.frama.io/ci-files/macos/portmidi.framework.zip"
unzip portmidi.framework.zip
mv license.txt portmidi-license.txt
cd ..
echo "portmidi" >> libs-changed.txt
fi
sudo cp -a dl_cache/portmidi.framework /Library/Frameworks/
# Download and install precompiled capsimage Framework
if [ ! -e dl_cache/capsimage_5.1_macos-x86_64-arm64 ]; then
cd dl_cache
wget "https://hatari.frama.io/ci-files/macos/capsimage_5.1_macos-x86_64-arm64_selfsigned.zip"
unzip capsimage_5.1_macos-x86_64-arm64_selfsigned.zip
cd capsimage_5.1_macos-x86_64-arm64
mv LICENCE.txt DONATIONS.txt README.txt HISTORY.txt CAPSImage.framework
cd ../..
echo "capsimage" >> libs-changed.txt
fi
sudo cp -a dl_cache/capsimage_5.1_macos-x86_64-arm64/CAPSImage.framework /Library/Frameworks/