2024-10-09 09:01:12 +02:00
---
2024-10-23 14:14:05 +02:00
name : 🍎 Build - MacOS Qt6
2024-10-09 09:01:12 +02:00
on :
2024-10-30 08:12:49 +01:00
# push:
# branches:
# - main
# pull_request:
# release:
# types: ['published']
2024-10-09 09:01:12 +02:00
workflow_dispatch :
concurrency :
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress : true
jobs :
build :
strategy :
matrix :
include :
# - os: macos-13
# triplet: x64-osx
# deployment-target: "10.15"
- os : macos-14
triplet : arm64-osx-dynamic-release
deployment-target : "11.0"
name : build (macos)
runs-on : ${{ matrix.os }}
steps :
- name : 🐣 Checkout
uses : actions/checkout@v4
- name : 🐩 Install CMake and Ninja
uses : lukka/get-cmake@latest
with :
# Pin to specific version to avoid rebuilding too often
# Also helps to avoid spurious build failures like https://github.com/qgis/QGIS/pull/47098
2024-10-23 14:14:05 +02:00
cmakeVersion : 3.30 .4
2024-10-09 09:01:12 +02:00
- name : 🎡 Setup vcpkg
id : setup-vcpkg
uses : ./.github/actions/setup-vcpkg
- name : 🔨 Prepare build env
run : |
brew install automake bison flex gnu-sed create-dmg autoconf-archive nasm libtool fdupes
echo $(brew --prefix bison)/bin >> $GITHUB_PATH
echo $(brew --prefix flex)/bin >> $GITHUB_PATH
echo $(brew --prefix libtool)/bin >> $GITHUB_PATH
- uses : actions/setup-python@v5
with :
python-version : '3.11'
- name : 🍭 Setup XCode
uses : maxim-lobanov/setup-xcode@v1.6.0
with :
xcode-version : latest-stable
- name : 🌱 Install dependencies and generate project files
run : |
echo "VCPKG_ROOT: ${VCPKG_ROOT}"
# Install first only with binarycaching, then deduplicate binaries and replace copies with symlinks.
# Nuget doesn't understand the symlink concept
cmake -S . \
-G Ninja \
-B build \
-D WITH_VCPKG=ON \
-D BUILD_WITH_QT6=ON \
-D WITH_QTWEBKIT=OFF \
-D WITH_BINDINGS=ON \
2024-10-23 14:14:05 +02:00
-D QGIS_MACAPP_FRAMEWORK=OFF \
2024-10-09 09:01:12 +02:00
-D VCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \
-D VCPKG_HOST_TRIPLET="${{ matrix.triplet }}" \
-D VCPKG_INSTALL_OPTIONS="--only-binarycaching" \
2024-10-09 10:56:41 +02:00
-D NUGET_USERNAME=${{ github.actor }} \
2024-10-09 09:01:12 +02:00
-D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} || true
fdupes -r -1 build/vcpkg_installed/arm64-osx-dynamic/lib | grep libQt | while read line; do master=""; for file in ${line[*]}; do if [[ "x${master}" == "x" ]]; then master=$file; else rm "${file}"; ln -s $(basename "${master}") "${file}"; fi; done; done
cmake -D VCPKG_INSTALL_OPTIONS="" build
- name : 📑 Upload vcpkg build logs
2024-11-01 19:18:17 +00:00
uses : actions/upload-artifact@v4
2024-10-09 09:01:12 +02:00
if : failure()
with :
name : build-logs-${{ matrix.triplet }}
path : |
2024-10-11 16:51:30 +02:00
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
2024-10-09 09:01:12 +02:00
- name : 📦 Create SDK
if : github.event_name == 'workflow_dispatch' || github.event_name == 'release'
run : |
./build/_deps/vcpkg-src/vcpkg export --zip --output-dir=./sdk --x-install-root=./build/vcpkg_installed --x-manifest-root=vcpkg
- name : 📤 Upload sdk
if : github.event_name == 'workflow_dispatch' || github.event_name == 'release'
uses : actions/upload-artifact@v4
with :
name : kadas-albireo2-sdk-${{ matrix.triplet }}
path : |
sdk/vcpkg-export-*.zip
- name : 🌋 Build
run : |
cmake --build build