-
Notifications
You must be signed in to change notification settings - Fork 270
264 lines (242 loc) · 8.26 KB
/
BuildPR.yml
File metadata and controls
264 lines (242 loc) · 8.26 KB
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
name: PullRequest
on:
push:
branches:
- master
tags:
- "*"
pull_request:
jobs:
buildMac:
name: "Build MacOS ${{ matrix.osversion }} with Qt 6"
runs-on: macos-${{ matrix.osversion }}
strategy:
fail-fast: false
matrix:
osversion: [ 14, 15, 15-intel ]
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Install Qt 6 (Framework build)
uses: jurplel/install-qt-action@v4
with:
host: 'mac'
target: 'desktop'
arch: 'clang_64'
modules: 'qtserialport'
- name: Configure project with CMake
run: |
mkdir build
cd build
echo "QT_ROOT_DIR=$QT_ROOT_DIR"
APP_DIR_NAME="DLTViewer.app"
cmake -G Ninja -DCMAKE_PREFIX_PATH=$QT_ROOT_DIR/lib/cmake \
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
-DCMAKE_BUILD_TYPE=Release \
-DDLT_USE_QT_RPATH=OFF \
-DDLT_PARSER=OFF \
-DDLT_APP_DIR_NAME=${APP_DIR_NAME} \
-DDLT_LIBRARY_INSTALLATION_PATH="${APP_DIR_NAME}/Contents/Frameworks" \
-DDLT_EXECUTABLE_INSTALLATION_PATH="${APP_DIR_NAME}/Contents/MacOS" \
-DDLT_RESOURCE_INSTALLATION_PATH="${APP_DIR_NAME}/Contents/Resources" \
-DDLT_PLUGIN_INSTALLATION_PATH="${APP_DIR_NAME}/Contents/MacOS/plugins" \
..
- name: Build project
run: |
cmake --build build --parallel 4
- name: Install and deploy with macdeployqt
run: |
cmake --install build --prefix $(pwd)/build/install
ls -l build/install/DLTViewer.app
otool -L build/install/DLTViewer.app/Contents/MacOS/dlt-viewer
otool -l build/install/DLTViewer.app/Contents/MacOS/dlt-viewer | grep -A2 LC_RPATH
echo "Deploying DLTViewer.app with macdeployqt"
$QT_ROOT_DIR/bin/macdeployqt build/install/DLTViewer.app -verbose=2 -dmg \
-libpath=$(pwd)/build/install/DLTViewer.app/Contents/Frameworks \
-executable=$(pwd)/build/install/DLTViewer.app/Contents/MacOS/dlt-viewer
- name: Codesign app bundle
if: "! github.event.pull_request.head.repo.fork " # not running on a fork
# Extract the secrets we defined earlier as environment variables
env:
MACOS_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.P12_PASSWORD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.APPLE_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: scripts/darwin/codesign.sh
- name: Notarize app bundle
if: "! github.event.pull_request.head.repo.fork " # not running on a fork
env:
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.APPLE_ID }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.APP_PASSWORD }}
run: scripts/darwin/notarize.sh
- name: Compress artifacts
run: |
cd $(pwd)/build
mkdir -p dist
tar -czvf "dist/DLTViewer-qt6-macos${{ matrix.osversion }}.tgz" -C $(pwd)/install .
- name: Upload artifacts
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: DLTViewer-macos${{ matrix.osversion }}-qt6
path: build/dist/DLTViewer*.tgz
buildUbuntu:
name: Build ${{ matrix.ubuntu }}
strategy:
matrix:
ubuntu: [ ubuntu-22.04, ubuntu-24.04 ]
runs-on: ${{ matrix.ubuntu }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: install build environment
run: scripts/linux/installUbuntu22and24.sh
- name: Build project
run: scripts/linux/buildUbuntu22and24.sh
- name: Run tests
run: ctest --test-dir build/qdlt
- name: Create package
if: ${{ matrix.ubuntu == 'ubuntu-24.04' }}
run: ./build_viewer_debs_noble.sh
- name: Archive artifact
if: ${{ matrix.ubuntu == 'ubuntu-24.04' && success() }}
uses: actions/upload-artifact@v7
with:
name: DLTViewer-Ubuntu-24.04
path: debtmp/covesa-dlt-viewer_*.deb
buildWindows_x64:
name: Build Windows x86_64
strategy:
matrix:
windows: [ windows-2022 ]
task: [ sdk ]
qt: [ 6 ]
runs-on: ${{ matrix.windows }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: Install qt
uses: jurplel/install-qt-action@v4
with:
modules: qtserialport
- name: Build with CMake ${{ matrix.task }}
run: >
$env:WORKSPACE=$env:GITHUB_WORKSPACE;
$env:CPACK_7Z="true";
$env:CPACK_NSIS="true";
./build_sdk_windows_qt${{ matrix.qt }}_MSVC_cmake.bat
- name: Archive artifact
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: DLTViewer-windows-x86_64
path: |
build/dist/DLTViewer*.7z
build/dist/DLTViewer*.exe
build/dist/*.md
buildWindows_arm:
name: Build Windows ARM
strategy:
matrix:
windows: [ windows-11-arm ]
task: [ sdk ]
qt: [ 6 ]
runs-on: ${{ matrix.windows }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: Install qt
uses: jurplel/install-qt-action@v4
with:
modules: qtserialport
- name: Build with CMake ${{ matrix.task }}
run: >
$env:WORKSPACE=$env:GITHUB_WORKSPACE;
$env:CPACK_7Z="true";
$env:CPACK_NSIS="true";
./build_sdk_windows_arm_qt${{ matrix.qt }}_MSVC_cmake.bat
- name: Archive artifact
uses: actions/upload-artifact@v7
if: ${{ success() }}
with:
name: DLTViewer-windows-arm64
path: |
build/dist/DLTViewer*.7z
build/dist/DLTViewer*.exe
build/dist/*.md
createRelease:
name: Create release
runs-on: ubuntu-24.04
needs: [ buildMac, buildUbuntu, buildWindows_x64, buildWindows_arm ]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
# TODO: restore AppImage build then enable this step, see https://github.com/COVESA/dlt-viewer/issues/717
# - name: Download DLT Linux artifacts
# uses: actions/download-artifact@v8
# with:
# name: DLT-Linux
# continue-on-error: true
- name: Download DLT macOS 14 artifacts arm64
uses: actions/download-artifact@v8
with:
name: DLTViewer-macos14-qt6
- name: Download DLT macOS 15 artifacts arm64
uses: actions/download-artifact@v8
with:
name: DLTViewer-macos15-qt6
- name: Download DLT macOS artifacts x86
uses: actions/download-artifact@v8
with:
name: DLTViewer-macos15-intel-qt6
- name: Download DLT Windows artifacts
uses: actions/download-artifact@v8
with:
name: DLTViewer-windows-x86_64
- name: Download DLT Windows arm artifacts
uses: actions/download-artifact@v8
with:
name: DLTViewer-windows-arm64
- name: Find Tag
id: tagger
uses: jimschubert/query-tag-action@v2.2
with:
skip-unshallow: 'true'
abbrev: false
commit-ish: HEAD
- name: Check pre-release
run: |
echo "tag=${{steps.tagger.outputs.tag}}"
if [[ ${{ steps.tagger.outputs.tag }} == *alpha* || ${{ steps.tagger.outputs.tag }} == *beta* ]]
then
prerelease=true
else
prerelease=false
fi
echo "PRE_RELEASE=$prerelease" >> $GITHUB_ENV
echo "prerelease=$prerelease"
- name: Create Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{steps.tagger.outputs.tag}}
generate_release_notes: true
prerelease: ${{ env.PRE_RELEASE }}
name: ${{steps.tagger.outputs.tag}}
files: |
DLT*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}