forked from maplibre/maplibre-native-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
228 lines (206 loc) · 6.92 KB
/
macOS.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: macOS CI
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "**"
paths-ignore:
- ".gitignore"
- "README.md"
- "docs/**"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/Android.yml"
- ".github/workflows/iOS.yml"
- ".github/workflows/Linux.yml"
- ".github/workflows/Windows.yml"
pull_request:
branches:
- main
paths-ignore:
- ".gitignore"
- "README.md"
- "docs/**"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/Android.yml"
- ".github/workflows/iOS.yml"
- ".github/workflows/Linux.yml"
- ".github/workflows/Windows.yml"
concurrency:
# cancel jobs on PRs only
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build-and-test:
name: Build (Qt${{ matrix.qt_version}}, ${{ matrix.compiler }})
runs-on: ${{ matrix.runs_on }}
strategy:
matrix:
include:
- qt_series: 5
qt_version: 5.15.2
qt_modules: ""
preset: macOS-legacy-ccache
compiler: default
runs_on: macos-13
- qt_series: 6
qt_version: 6.5.3
qt_modules: qtlocation qtpositioning
preset: macOS-ccache
compiler: default
runs_on: macos-14
- qt_series: 6
qt_version: 6.6.3
qt_modules: qtlocation qtpositioning
preset: macOS-ccache
compiler: default
runs_on: macos-14
- qt_series: 6
qt_version: 6.7.2
qt_modules: qtlocation qtpositioning
preset: macOS-ccache
compiler: default
runs_on: macos-14
- qt_series: 6
qt_version: 6.7.2
preset: macOS-ccache
compiler: static
runs_on: macos-14
- qt_series: 6
qt_version: 6.7.2
qt_modules: qtlocation qtpositioning
preset: macOS-clang-tidy
compiler: llvm
runs_on: macos-14
env:
COMPILER: ${{ matrix.compiler }}
PRESET: ${{ matrix.preset }}
QT_VERSION: ${{ matrix.qt_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: source
submodules: recursive
fetch-depth: 0
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup compiler (macOS)
if: matrix.compiler != 'default' && matrix.compiler != 'static'
run: |
brew install "$COMPILER"
echo "/opt/homebrew/opt/${COMPILER}/bin" >> "$GITHUB_PATH"
{
echo "CC=/opt/homebrew/opt/${COMPILER}/bin/clang"
echo "CXX=/opt/homebrew/opt/${COMPILER}/bin/clang++"
echo "LDFLAGS=\"-L/opt/homebrew/opt/${COMPILER}/lib\""
echo "CPPFLAGS=\"-I/opt/homebrew/opt/${COMPILER}/include\""
} >> "$GITHUB_ENV"
- name: Download Qt
if: matrix.compiler != 'static'
uses: jurplel/install-qt-action@v4
with:
aqtversion: ==3.1.*
version: ${{ matrix.qt_version }}
target: desktop
modules: ${{ matrix.qt_modules }}
- name: Download Static Qt
if: matrix.compiler == 'static'
run: |
cd ..
wget https://github.com/ntadej/qt-build/releases/download/v${QT_VERSION}.0/Qt_macOS_static.tar.bz2
tar xvf Qt_macOS_static.tar.bz2
echo "QT_ROOT_DIR=$PWD/Qt/$QT_VERSION/macos_static" >> $GITHUB_ENV
echo "$PWD/Qt/$QT_VERSION/macos_static/bin" >> $GITHUB_PATH
cd $GITHUB_WORKSPACE
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: macOS_${{ matrix.qt_version }}_${{ matrix.compiler }}
max-size: 200M
- name: Build
working-directory: source
run: |
cmake --workflow --preset ${PRESET}
- name: Install
run: |
mkdir install && cd install
tar xf ../build/qt${{ matrix.qt_series }}-macOS/maplibre-native-qt_*.tar.bz2
mv maplibre-native-qt_* maplibre-native-qt
- name: Build QtQuick Example
if: matrix.qt_series == 6 && matrix.compiler == 'default'
working-directory: source/examples/quick
run: |
export QMapLibre_DIR="$GITHUB_WORKSPACE/install/maplibre-native-qt"
cmake --workflow --preset default
- name: Build QtWidgets Example
if: matrix.qt_series == 6 && matrix.compiler == 'default'
working-directory: source/examples/widgets
run: |
export QMapLibre_DIR="$GITHUB_WORKSPACE/install/maplibre-native-qt"
cmake --workflow --preset default
- name: Upload installation
if: matrix.compiler == 'default' || matrix.compiler == 'static'
uses: actions/upload-artifact@v4
with:
name: macOS_${{ matrix.qt_version }}_${{ matrix.compiler }}
path: build/qt${{ matrix.qt_series }}-macOS/maplibre-native-qt_*.tar.bz2
- name: Upload examples
if: matrix.qt_series == 6 && matrix.compiler == 'default'
uses: actions/upload-artifact@v4
with:
name: macOS_${{ matrix.qt_version }}_examples
path: build/qt${{ matrix.qt_series }}-example-*/*.tar.bz2
release:
name: Release
if: github.ref_type == 'tag'
runs-on: macos-14
needs: build-and-test
permissions:
contents: write
strategy:
matrix:
include:
- qt_version: 5.15.2
compiler: default
suffix: ""
- qt_version: 6.5.3
compiler: default
suffix: ""
- qt_version: 6.6.3
compiler: default
suffix: ""
- qt_version: 6.7.2
compiler: default
suffix: ""
- qt_version: 6.7.2
compiler: static
suffix: "_static"
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: macOS_${{ matrix.qt_version }}_${{ matrix.compiler }}
- name: Rename artifacts
if: matrix.compiler != 'default'
env:
QT_VERSION: ${{ matrix.qt_version }}
TAG_NAME: ${{ github.ref_name }}
PLATFORM_SUFFIX: ${{ matrix.suffix }}
run: |
mv maplibre-native-qt_${TAG_NAME}_Qt${QT_VERSION}_macOS.tar.bz2 maplibre-native-qt_${TAG_NAME}_Qt${QT_VERSION}_macOS${PLATFORM_SUFFIX}.tar.bz2
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: maplibre-native-qt_${{ github.ref_name }}_Qt${{ matrix.qt_version }}_macOS${{ matrix.suffix }}.tar.bz2
allowUpdates: true
draft: true