|
52 | 52 | failOnError: false |
53 | 53 | warnIfNotFound: false |
54 | 54 |
|
55 | | - checks: |
56 | | - runs-on: ubuntu-22.04 |
57 | | - needs: preBuild |
58 | | - |
59 | | - steps: |
60 | | - - name: Checkout repository |
61 | | - uses: actions/checkout@v4 |
62 | | - with: |
63 | | - fetch-depth: '0' |
64 | | - - name: Install gitlint |
65 | | - run: | |
66 | | - pip install gitlint==0.19.1 |
67 | | - - name: Run gitlint |
68 | | - run: gitlint --commits d789f61044e63e1a00d8e9f1d4d49c8d9ffc42a9..HEAD |
69 | | - - name: Install REUSE |
70 | | - run: | |
71 | | - pip install reuse==4.0.3 |
72 | | - - name: Run REUSE lint |
73 | | - run: reuse lint |
74 | | - - name: Run clang-format |
75 | | - run: | |
76 | | - scripts/run_clang_format.py |
77 | | - - uses: Trass3r/setup-cpp@1b63900ecf3f0b7c60ee53aa7be122f2c4fe7a2c |
78 | | - - name: Run cppcheck |
79 | | - run: | |
80 | | - sudo apt-get -y install cppcheck |
81 | | - cppcheck --template=gcc --inline-suppr --std=c++17 --enable=style,unusedFunction \ |
82 | | - -i src/plugins/weatherdata/gfs/g2clib -DCPPCHECK --force --suppressions-list=cppcheck.supp \ |
83 | | - --library=qt.cfg --library=posix.cfg . |
84 | | - - name: Run doxygen |
85 | | - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} |
86 | | - working-directory: docs |
87 | | - run: | |
88 | | - sudo apt-get -y install doxygen graphviz |
89 | | - doxygen Doxyfile |
90 | | - env: |
91 | | - DOXY_SRC_ROOT: .. |
92 | | - - name: Upload doxygen |
93 | | - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} |
94 | | - uses: actions/upload-pages-artifact@v3 |
95 | | - with: |
96 | | - path: docs/html/ |
97 | | - |
98 | 55 | buildLinux: |
99 | 56 | runs-on: ubuntu-22.04 |
100 | | - needs: [preBuild, checks] |
| 57 | + needs: [preBuild] |
101 | 58 | env: |
102 | 59 | BACKTRACE_SYMBOL_TOKEN: ${{ secrets.BACKTRACE_SYMBOL_TOKEN }} |
103 | 60 | BACKTRACE_MINIDUMP_TOKEN: ${{ secrets.BACKTRACE_MINIDUMP_TOKEN }} |
@@ -187,327 +144,3 @@ jobs: |
187 | 144 | with: |
188 | 145 | name: xswiftbus-thin-linux-64-${{ needs.preBuild.outputs.version }} |
189 | 146 | path: ${{ github.workspace }}/xswiftbus-* |
190 | | - |
191 | | - buildWin64: |
192 | | - runs-on: windows-2022 |
193 | | - needs: [preBuild, checks] |
194 | | - env: |
195 | | - BACKTRACE_SYMBOL_TOKEN: ${{ secrets.BACKTRACE_SYMBOL_TOKEN }} |
196 | | - BACKTRACE_MINIDUMP_TOKEN: ${{ secrets.BACKTRACE_MINIDUMP_TOKEN }} |
197 | | - BITROCK_BUILDER: "~/installbuilder/bin/builder-cli.exe" |
198 | | - |
199 | | - steps: |
200 | | - - name: Install Qt |
201 | | - uses: jurplel/install-qt-action@v4 |
202 | | - with: |
203 | | - version: ${{ env.qt_version }} |
204 | | - modules: 'qtmultimedia' |
205 | | - arch: win64_msvc2022_64 |
206 | | - cache: true |
207 | | - - name: Install Qt debug info |
208 | | - uses: jurplel/install-qt-action@v4 |
209 | | - with: |
210 | | - version: ${{ env.qt_version }} |
211 | | - arch: win64_msvc2022_64 |
212 | | - cache: true |
213 | | - modules: debug_info |
214 | | - extra: --archives qtbase |
215 | | - - name: Cache InstallBuilder |
216 | | - id: cache-bitrock |
217 | | - uses: actions/cache@v4 |
218 | | - with: |
219 | | - path: C:\installbuilder.exe |
220 | | - key: installbuilder-${{ env.bitrock_version }}-windows-x64 |
221 | | - - name: Download InstallBuilder |
222 | | - if: steps.cache-bitrock.outputs.cache-hit != 'true' |
223 | | - shell: C:\msys64\usr\bin\bash.exe -le {0} |
224 | | - run: | |
225 | | - wget --retry-connrefused -t 10 -w 10 -T 60 -O /c/installbuilder.exe ${{ env.bitrock_url }}/installbuilder-${{ env.bitrock_version }}-windows-x64-installer.exe |
226 | | - env: |
227 | | - MSYSTEM: MSYS2 |
228 | | - - name: Install InstallBuilder |
229 | | - run: | |
230 | | - start -wait "C:\installbuilder.exe" @("--mode", "unattended", "--prefix", "$HOME\installbuilder") |
231 | | - echo >$HOME\license.xml @" |
232 | | - $env:BITROCK_LICENSE |
233 | | - "@ |
234 | | - env: |
235 | | - BITROCK_LICENSE: ${{ secrets.BITROCK_LICENSE }} |
236 | | - - name: Install dependencies |
237 | | - run: | |
238 | | - pip install requests PyInstaller |
239 | | - - name: Checkout repository |
240 | | - uses: actions/checkout@v4 |
241 | | - with: |
242 | | - submodules: true |
243 | | - fetch-depth: 0 |
244 | | - - name: Checkout externals |
245 | | - if: ${{ env.use_externals == 'true' }} |
246 | | - uses: actions/checkout@v4 |
247 | | - env: |
248 | | - EXTERNALS_PAT: ${{ secrets.EXTERNALS_PAT }} |
249 | | - with: |
250 | | - repository: ${{ env.externals }} |
251 | | - ref: ${{ env.externals_sha }} |
252 | | - token: ${{ env.EXTERNALS_PAT }} |
253 | | - path: 'third_party/externals' |
254 | | - - name: Create Vatsim key file |
255 | | - if: ${{ env.do_vatsim_key == 'true' }} |
256 | | - run: | |
257 | | - echo >vatsim.json @" |
258 | | - { "vatsim": { "id": "$env:VATSIM_ID", "key": "$env:VATSIM_KEY" } } |
259 | | - "@ |
260 | | - env: |
261 | | - VATSIM_ID: ${{ secrets.VATSIM_ID }} |
262 | | - VATSIM_KEY: ${{ secrets.VATSIM_KEY }} |
263 | | - - uses: Trass3r/setup-cpp@1b63900ecf3f0b7c60ee53aa7be122f2c4fe7a2c |
264 | | - - name: Build swift (without symbols) |
265 | | - if: ${{ env.do_symbols != 'true' }} |
266 | | - run: | |
267 | | - python -u scripts/build.py -w 64 -t msvc |
268 | | - - name: Build swift (with symbols) |
269 | | - if: ${{ env.do_symbols == 'true' }} |
270 | | - run: | |
271 | | - python -u scripts/build.py -w 64 -t msvc --upload-symbols |
272 | | - - name: Upload installer |
273 | | - uses: actions/upload-artifact@v4 |
274 | | - with: |
275 | | - name: swiftinstaller-windows-64-${{ needs.preBuild.outputs.version }} |
276 | | - path: ${{ github.workspace }}/swiftinstaller-* |
277 | | - - name: Upload symbols |
278 | | - uses: actions/upload-artifact@v4 |
279 | | - if: ${{ env.do_symbols == 'true' }} |
280 | | - with: |
281 | | - name: swiftsymbols-windows-64-${{ needs.preBuild.outputs.version }} |
282 | | - path: ${{ github.workspace }}/swiftsymbols-* |
283 | | - - name: Upload xswiftbus |
284 | | - uses: actions/upload-artifact@v4 |
285 | | - with: |
286 | | - name: xswiftbus-thin-windows-64-${{ needs.preBuild.outputs.version }} |
287 | | - path: ${{ github.workspace }}/xswiftbus-* |
288 | | - |
289 | | - buildMacOS: |
290 | | - runs-on: macos-13 |
291 | | - needs: [preBuild, checks] |
292 | | - env: |
293 | | - BACKTRACE_SYMBOL_TOKEN: ${{ secrets.BACKTRACE_SYMBOL_TOKEN }} |
294 | | - BACKTRACE_MINIDUMP_TOKEN: ${{ secrets.BACKTRACE_MINIDUMP_TOKEN }} |
295 | | - BITROCK_BUILDER: /Applications/installbuilder/bin/Builder.app/Contents/MacOS/installbuilder.sh |
296 | | - |
297 | | - steps: |
298 | | - - name: Install Qt |
299 | | - uses: jurplel/install-qt-action@v4 |
300 | | - with: |
301 | | - version: ${{ env.qt_version }} |
302 | | - modules: 'qtmultimedia' |
303 | | - cache: true |
304 | | - - name: Cache InstallBuilder |
305 | | - id: cache-bitrock |
306 | | - uses: actions/cache@v4 |
307 | | - with: |
308 | | - path: ~/installbuilder.dmg |
309 | | - key: installbuilder-${{ env.bitrock_version }}-osx |
310 | | - - name: Download InstallBuilder |
311 | | - if: steps.cache-bitrock.outputs.cache-hit != 'true' |
312 | | - run: | |
313 | | - wget --retry-connrefused -t 10 -w 10 -T 60 -O $HOME/installbuilder.dmg ${{ env.bitrock_url }}/installbuilder-${{ env.bitrock_version }}-osx-installer.dmg |
314 | | - - name: Install InstallBuilder |
315 | | - run: | |
316 | | - chmod 700 $HOME/installbuilder.dmg |
317 | | - sudo hdiutil attach $HOME/installbuilder.dmg |
318 | | - sudo cp -rf "/Volumes/InstallBuilder Qt/installbuilder-${{ env.bitrock_version }}-osx-installer.app" /Applications |
319 | | - sudo hdiutil detach "/Volumes/InstallBuilder Qt" |
320 | | - sudo spctl --master-disable |
321 | | - sudo chmod -R +x /Applications/installbuilder-${{ env.bitrock_version }}-osx-installer.app |
322 | | - sudo xattr -r -d com.apple.quarantine /Applications/installbuilder-${{ env.bitrock_version }}-osx-installer.app |
323 | | - sudo /Applications/installbuilder-${{ env.bitrock_version }}-osx-installer.app/Contents/MacOs/installbuilder.sh --mode unattended --prefix /Applications/installbuilder |
324 | | - cat >~/license.xml <<EOF |
325 | | - $BITROCK_LICENSE |
326 | | - EOF |
327 | | - env: |
328 | | - BITROCK_LICENSE: ${{ secrets.BITROCK_LICENSE }} |
329 | | - - name: Install dependencies |
330 | | - run: | |
331 | | - pip3 install requests |
332 | | - - name: Checkout repository |
333 | | - uses: actions/checkout@v4 |
334 | | - with: |
335 | | - submodules: true |
336 | | - fetch-depth: 0 |
337 | | - - name: Checkout externals |
338 | | - if: ${{ env.use_externals == 'true' }} |
339 | | - uses: actions/checkout@v4 |
340 | | - env: |
341 | | - EXTERNALS_PAT: ${{ secrets.EXTERNALS_PAT }} |
342 | | - with: |
343 | | - repository: ${{ env.externals }} |
344 | | - ref: ${{ env.externals_sha }} |
345 | | - token: ${{ env.EXTERNALS_PAT }} |
346 | | - path: 'third_party/externals' |
347 | | - - name: Create Vatsim key file |
348 | | - if: ${{ env.do_vatsim_key == 'true' }} |
349 | | - run: | |
350 | | - cat >vatsim.json <<EOF |
351 | | - { "vatsim": { "id": "$VATSIM_ID", "key": "$VATSIM_KEY" } } |
352 | | - EOF |
353 | | - env: |
354 | | - VATSIM_ID: ${{ secrets.VATSIM_ID }} |
355 | | - VATSIM_KEY: ${{ secrets.VATSIM_KEY }} |
356 | | - - uses: Trass3r/setup-cpp@1b63900ecf3f0b7c60ee53aa7be122f2c4fe7a2c |
357 | | - - name: Build swift (without symbols) |
358 | | - if: ${{ env.do_symbols != 'true' }} |
359 | | - run: | |
360 | | - python3 -u scripts/build.py -w 64 -t clang |
361 | | - - name: Build swift (with symbols) |
362 | | - if: ${{ env.do_symbols == 'true' }} |
363 | | - run: | |
364 | | - python3 -u scripts/build.py -w 64 -t clang --upload-symbols |
365 | | - - name: Upload installer |
366 | | - uses: actions/upload-artifact@v4 |
367 | | - with: |
368 | | - name: swiftinstaller-macos-64-${{ needs.preBuild.outputs.version }} |
369 | | - path: ${{ github.workspace }}/swiftinstaller-* |
370 | | - - name: Upload symbols |
371 | | - uses: actions/upload-artifact@v4 |
372 | | - if: ${{ env.do_symbols == 'true' }} |
373 | | - with: |
374 | | - name: swiftsymbols-macos-64-${{ needs.preBuild.outputs.version }} |
375 | | - path: ${{ github.workspace }}/swiftsymbols-* |
376 | | - - name: Upload xswiftbus |
377 | | - uses: actions/upload-artifact@v4 |
378 | | - with: |
379 | | - name: xswiftbus-thin-macos-64-${{ needs.preBuild.outputs.version }} |
380 | | - path: ${{ github.workspace }}/xswiftbus-* |
381 | | - |
382 | | - postBuild: |
383 | | - runs-on: ubuntu-22.04 |
384 | | - needs: [preBuild, checks, buildLinux, buildWin64, buildMacOS] |
385 | | - |
386 | | - steps: |
387 | | - - name: Download xswiftbus-thin |
388 | | - uses: actions/download-artifact@v4 |
389 | | - with: |
390 | | - pattern: xswiftbus-thin-* |
391 | | - merge-multiple: true |
392 | | - - name: Repackage xswiftbus |
393 | | - run: | |
394 | | - 7z x -y xswiftbus-windows-64-*.7z |
395 | | - 7z x -y xswiftbus-linux-64-*.7z |
396 | | - 7z x -y xswiftbus-macos-64-*.7z |
397 | | - 7z a -y -mx=9 xswiftbus-fat-allos-${{ needs.preBuild.outputs.version }}.7z xswiftbus |
398 | | - - name: Upload xswiftbus-fat |
399 | | - uses: actions/upload-artifact@v4 |
400 | | - with: |
401 | | - name: xswiftbus-fat-allos-${{ needs.preBuild.outputs.version }} |
402 | | - path: xswiftbus-fat-allos-* |
403 | | - - name: Remove xswiftbus-thin artifacts |
404 | | - uses: swift-project/delete-artifact@swift |
405 | | - with: |
406 | | - name: xswiftbus-thin-* |
407 | | - |
408 | | - release: |
409 | | - runs-on: ubuntu-22.04 |
410 | | - needs: [preBuild, postBuild] |
411 | | - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} |
412 | | - outputs: |
413 | | - id: ${{ steps.create.outputs.release_id }} |
414 | | - permissions: |
415 | | - id-token: write |
416 | | - contents: write |
417 | | - pages: write |
418 | | - environment: github-pages |
419 | | - |
420 | | - steps: |
421 | | - - name: Download artifacts |
422 | | - uses: actions/download-artifact@v4 |
423 | | - - name: Flatten directories |
424 | | - run: | |
425 | | - mv swiftinstaller-*/* . |
426 | | - mv xswiftbus-*/* . |
427 | | - mkdir swiftsymbols |
428 | | - mv swiftsymbols-*/* swiftsymbols |
429 | | - - name: Create release |
430 | | - uses: swift-project/[email protected] |
431 | | - id: create |
432 | | - with: |
433 | | - token: ${{ secrets.GITHUB_TOKEN }} |
434 | | - tag: v${{ needs.preBuild.outputs.version }} |
435 | | - commitish: ${{ github.sha }} |
436 | | - body: Version ${{ needs.preBuild.outputs.version }} |
437 | | - draft: true |
438 | | - prerelease: true |
439 | | - gzip: folders |
440 | | - files: > |
441 | | - swiftinstaller-linux-64-${{ needs.preBuild.outputs.version }}.run |
442 | | - swiftinstaller-windows-64-${{ needs.preBuild.outputs.version }}.exe |
443 | | - swiftinstaller-macos-64-${{ needs.preBuild.outputs.version }}.dmg |
444 | | - xswiftbus-fat-allos-${{ needs.preBuild.outputs.version }}.7z |
445 | | - swiftsymbols-allos-${{ needs.preBuild.outputs.version }}:swiftsymbols |
446 | | - - name: Publish doxygen |
447 | | - uses: actions/deploy-pages@v4 |
448 | | - |
449 | | - notify: |
450 | | - runs-on: ubuntu-22.04 |
451 | | - needs: [preBuild, checks, buildLinux, buildWin64, buildMacOS, postBuild, release] |
452 | | - if: always() |
453 | | - |
454 | | - steps: |
455 | | - - name: Install dependencies |
456 | | - run: | |
457 | | - sudo apt-get -y install jo jq |
458 | | - - name: Query GitHub annotations |
459 | | - |
460 | | - id: checkruns |
461 | | - env: |
462 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
463 | | - with: |
464 | | - route: GET /repos/swift-project/pilotclient/commits/${{ github.sha }}/check-runs |
465 | | - - name: Prepare Discord build message |
466 | | - run: | |
467 | | - result=SKIPPED |
468 | | - ${{ contains(needs.*.result, 'success') }} && result=SUCCESS |
469 | | - for run in $CHECK_RUNS; do |
470 | | - curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" \ |
471 | | - "https://api.github.com/repos/swift-project/pilotclient/check-runs/$run/annotations" \ |
472 | | - | jq -e 'any(.[].annotation_level; . == "warning" or . == "error")' && result=WARNING |
473 | | - done |
474 | | - ${{ contains(needs.*.result, 'cancelled') }} && result=CANCELLED |
475 | | - ${{ contains(needs.*.result, 'failure') }} && result=FAILED |
476 | | - [[ $result = SKIPPED ]] && emoji=repeat |
477 | | - [[ $result = SUCCESS ]] && emoji=white_check_mark |
478 | | - [[ $result = WARNING ]] && emoji=warning |
479 | | - [[ $result = CANCELLED ]] && emoji=grey_question |
480 | | - [[ $result = FAILED ]] && emoji=x |
481 | | - echo "result=$result" >>$GITHUB_ENV |
482 | | - echo "emoji=$emoji" >>$GITHUB_ENV |
483 | | - env: |
484 | | - CHECK_RUNS: ${{ join(fromJson(steps.checkruns.outputs.data).check_runs.*.id, ' ') }} |
485 | | - TOKEN: ${{ secrets.GITHUB_TOKEN }} |
486 | | - - name: Prepare Discord release message |
487 | | - |
488 | | - if: ${{ needs.release.result == 'success' }} |
489 | | - id: release |
490 | | - env: |
491 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
492 | | - with: |
493 | | - route: GET /repos/swift-project/pilotclient/releases/${{ needs.release.outputs.id }} |
494 | | - - name: Send Discord build message |
495 | | - run: | |
496 | | - cat >message <<EOF |
497 | | - > :${{ env.emoji }}: \`${{ github.ref }}\` |
498 | | - > **${{ env.result }}** (triggered by ${{ github.event_name }}) |
499 | | - > <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}> |
500 | | - EOF |
501 | | - jo content=@message | curl -i -H "Accept: application/json" -H "Content-Type: application/json" $WEBHOOK -d @- |
502 | | - env: |
503 | | - WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} |
504 | | - - name: Send Discord release message |
505 | | - if: ${{ needs.release.result == 'success' }} |
506 | | - run: | |
507 | | - cat >message <<EOF |
508 | | - > :package: Created draft release \`v${{ needs.preBuild.outputs.version }}\` |
509 | | - > <${{ fromJson(steps.release.outputs.data).html_url }}> |
510 | | - EOF |
511 | | - jo content=@message | curl -i -H "Accept: application/json" -H "Content-Type: application/json" $WEBHOOK -d @- |
512 | | - env: |
513 | | - WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} |
0 commit comments