Skip to content

Build packages

Build packages #12

Workflow file for this run

name: Build packages
on:
workflow_dispatch:
workflow_call:
outputs:
package_mac:
description: "The file name of the macOS package"
value: ${{ jobs.build_macos.outputs.package_name }}
jobs:
build_macos:
name: Create macOS package
runs-on: macos-13
outputs:
package_name: ${{ steps.name_pkg.outputs.package_name }}
timeout-minutes: 240
env:
MACOSX_DEPLOYMENT_TARGET: "13.3"
QT_VERSION: "6.7.2"
EXTRA_CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=Release -DVC_PREBUILT_LIBS=ON -DVC_BUILD_ACVD=ON -DCMAKE_OSX_ARCHITECTURES:STRING='x86_64;arm64'"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 20
- name: Install Homebrew dependencies
run: |
brew update
brew unlink libtiff
brew install ninja python@3.12
- name: Remove conflicting packages
run: |
sudo rm -rf /Library/Frameworks/Mono.framework/
- name: Use the Command Line Tools
run: |
sudo xcode-select -s /Library/Developer/CommandLineTools
- name: Install Qt6
run: |
python3.12 -m pip install --upgrade pip setuptools wheel
python3.12 -m pip install aqtinstall
aqt install-qt -O ${{ github.workspace }}/Qt/ mac desktop ${QT_VERSION}
- name: Install vc-deps
run: |
git submodule update --init
cmake -S vc-deps/ -B vc-deps/build/ -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_MESSAGE=NEVER -DVCDEPS_BUILD_ACVD=OFF -DBUILD_MACOS_MULTIARCH=ON
cmake --build vc-deps/build/
- name: Build volume-cartographer
run: |
export CMAKE_INSTALL_PREFIX="packaged_install/"
cmake -S . -B build/ -GNinja ${EXTRA_CMAKE_FLAGS} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Qt/${QT_VERSION}/macos/lib/cmake/
cmake --build build/
echo "install_dir=${CMAKE_INSTALL_PREFIX}" >> ${GITHUB_ENV}
- name: Generate package name
id: name_pkg
run: |
if [[ ${{ github.ref }} =~ ^refs/tags/v* ]]; then
PKG_NAME="VC-${GITHUB_REF_NAME:1}-Darwin.zip"
else
PKG_NAME="VC-${GITHUB_REF_NAME}-Darwin.zip"
fi
echo "package_name=${PKG_NAME}" >> ${GITHUB_ENV}
echo "package_name=${PKG_NAME}" >> ${GITHUB_OUTPUT}
- name: Create package
run: |
cmake --install build/ --prefix "${{ env.install_dir }}"
python3.12 utils/scripts/macos_codesign_release.py -i "${{ env.install_dir }}"
ditto -c -k "${{ env.install_dir }}" ${{ env.package_name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: package-macos
path: ${{ env.package_name }}