Skip to content

tweaks to the macos runner #10

tweaks to the macos runner

tweaks to the macos runner #10

Workflow file for this run

name: macOS Builds
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [macos-12, macos-14]
include:
- os: macos-12
arch: x64
- os: macos-14
arch: arm64
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Get version
uses: actions/checkout@v4
with:
path: repo
- name: Get OS version
run: |
echo "OS_VERSION=$(sw_vers -productVersion | cut -d . -f 1,2)" >> $GITHUB_ENV
- name: Download source
run: |
export ART_DIR="ART-$(cat repo/version.txt)"
#wget https://bitbucket.org/agriggio/art/downloads/${ART_DIR}.tar.xz
#tar xJf ${ART_DIR}.tar.xz
git clone --depth 1 --branch macos-bundle-simplified https://[email protected]/agriggio/art.git ${ART_DIR}
- if: ${{ matrix.os == 'macos-12' }}
name: Install MacPorts x64
run: |
wget https://github.com/macports/macports-base/releases/download/v2.10.4/MacPorts-2.10.4-12-Monterey.pkg
sudo installer -pkg MacPorts-2.10.4-12-Monterey.pkg -target /
- if: ${{ matrix.os == 'macos-14' }}
name: Install MacPorts arm64
run: |
wget https://github.com/macports/macports-base/releases/download/v2.10.4/MacPorts-2.10.4-14-Sonoma.pkg
sudo installer -pkg MacPorts-2.10.4-14-Sonoma.pkg -target /
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
- name: Install base ports
run: |
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
sudo port -d install pkgconfig
sudo port install automake
sudo port install autoconf
sudo port install libtool
sudo port install cmake
sudo port install glib2 +quartz
sudo port install gtkmm3 +quartz
sudo port install gtk-osx-application-gtk3
sudo port install libomp
sudo port install clang-17
sudo port install librsvg-devel
sudo port install lensfun
sudo port install exiv2
sudo port install fftw-3-single +openmp
sudo port install openexr
sudo port install lcms2
sudo port install adwaita-icon-theme
- name: Install LibRaw
run: |
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
INSTDIR=/opt/art-deps
git clone --depth 1 https://github.com/LibRaw/LibRaw.git
git clone --depth 1 https://github.com/LibRaw/LibRaw-cmake.git
cd LibRaw
ln -s ../LibRaw-cmake/CMakeLists.txt
ln -s ../LibRaw-cmake/cmake
mkdir build
cd build
/opt/local/bin/cmake \
-DCMAKE_C_COMPILER=/opt/local/bin/clang-mp-17 \
-DCMAKE_CXX_COMPILER=/opt/local/bin/clang++-mp-17 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTDIR \
-DENABLE_X3FTOOLS=1 \
..
make -j$(nproc)
sudo make install
- name: Install CTL
run: |
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
INSTDIR=/opt/art-deps
git clone --depth 1 https://github.com/ampas/CTL.git
mkdir build-CTL
cd build-CTL
/opt/local/bin/cmake \
-DCMAKE_C_COMPILER=/opt/local/bin/clang-mp-17 \
-DCMAKE_CXX_COMPILER=/opt/local/bin/clang++-mp-17 \
-DCMAKE_INSTALL_PREFIX=$INSTDIR \
-DCMAKE_BUILD_TYPE=Release \
../CTL
make -j$(nproc)
sudo make install
- name: Install OpenColorIO
run: |
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
INSTDIR=/opt/art-deps
OCIO_VERSION='2.4.0'
mkdir ocio
cd ocio
wget https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/refs/tags/v${OCIO_VERSION}.tar.gz
tar xzf v${OCIO_VERSION}.tar.gz
mkdir build
cd build
/opt/local/bin/cmake \
-DCMAKE_C_COMPILER=/opt/local/bin/clang-mp-17 \
-DCMAKE_CXX_COMPILER=/opt/local/bin/clang++-mp-17 \
-DCMAKE_INSTALL_PREFIX=$INSTDIR \
-DCMAKE_BUILD_TYPE=Release \
-DOCIO_BUILD_PYTHON=OFF \
-DOCIO_BUILD_APPS=0 \
-DOCIO_BUILD_TESTS=0 \
-DOCIO_BUILD_GPU_TESTS=0 \
../OpenColorIO-${OCIO_VERSION}
make -j$(nproc)
sudo make install
- name: Configure build
run: |
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
export ART_DIR="ART-$(cat repo/version.txt)"
mkdir build
cd build
export PKG_CONFIG_PATH=/opt/art-deps/lib/pkgconfig
/opt/local/bin/cmake \
-DCMAKE_C_COMPILER=/opt/local/bin/clang-mp-17 \
-DCMAKE_CXX_COMPILER=/opt/local/bin/clang++-mp-17 \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_CTL=1 \
-DENABLE_LIBRAW=1 \
-DCTL_INCLUDE_DIR=/opt/art-deps/include/CTL \
-DCMAKE_LIBRARY_PATH=/opt/art-deps/lib \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$OS_VERSION \
../${ART_DIR}
cd ..
- name: Build
run: |
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
make -j$(nproc)
make install
- name: Include Lensfun
run: |
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH
lensfun-update-data
- name: Create bundle
run: |
ART_NAME="ART-$(cat repo/version.txt)"
OUTDIR=$(pwd)
cd build/Release/ART.app
python "${OUTDIR}/${ART_NAME}/tools/osx/bundle_ART.py" \
-o "${OUTDIR}" -v -r /opt/art-deps/lib \
-d "${ART_NAME}_macOS-${OS_VERSION}_${{ matrix.arch }}"
cd "${OUTDIR}"
- name: Prepare artifact name
run: |
ARTIFACT_NAME="ART-$(cat repo/version.txt)_macOS-${OS_VERSION}_${{ matrix.arch }}.dmg"
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
#echo "RELEASE_TAG=v$(cat repo/version.txt)" >> $GITHUB_ENV
echo "RELEASE_TAG=macOS-testing" >> $GITHUB_ENV
- name: Publish release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.RELEASE_TAG }}
body: ${{ env.RELEASE_TAG }}
allowUpdates: true
makeLatest: false
draft: true
artifacts: ${{ env.ARTIFACT_NAME }}