-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (92 loc) · 3.62 KB
/
build-macos-qt6.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
name: 🍎 Build - MacOS Qt6
on:
# push:
# branches:
# - main
# pull_request:
# release:
# types: ['published']
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
cmakeVersion: 3.30.4
- 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 \
-D QGIS_MACAPP_FRAMEWORK=OFF \
-D VCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \
-D VCPKG_HOST_TRIPLET="${{ matrix.triplet }}" \
-D VCPKG_INSTALL_OPTIONS="--only-binarycaching" \
-D NUGET_USERNAME=${{ github.actor }} \
-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
uses: actions/upload-artifact@v4
if: failure()
with:
name: build-logs-${{ matrix.triplet }}
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- 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