forked from qTox/qTox
-
Notifications
You must be signed in to change notification settings - Fork 5
499 lines (481 loc) · 19.3 KB
/
build-test-deploy.yaml
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
name: Build, test, and deploy
on:
# release:
# types: [published, edited]
push:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- '.github/workflows/startup-tests.yml'
- '.github/workflows/change_log.yml'
- '.github/workflows/nixos.yaml'
pull_request:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- '.github/workflows/startup-tests.yml'
- '.github/workflows/change_log.yml'
- '.github/workflows/nixos.yaml'
workflow_dispatch:
inputs:
version:
description: dummy
default: dummy
jobs:
update-nightly-tag:
name: Update nightly release tag
runs-on: ubuntu-22.04
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Move nightly tag to head for nightly release
run: git tag -f nightly && git push origin nightly -f
build-flatpak-docker:
name: Build flatpak docker
runs-on: ubuntu-22.04
if: ${{ true }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: flatpak
build-ubuntu-lts-docker:
name: Build ubuntu LTS docker image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: ubuntu_lts
build-ubuntu-for-appimage-docker:
name: Build ubuntu for AppImage docker image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: ubuntu_for_appimage
build-ubuntu-for-asan-appimage-docker:
name: Build ubuntu for ASAN AppImage docker image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: ubuntu_for_asan_appimage
build-debian-docker:
name: Build debian docker image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: debian
build-debian:
name: Debian
runs-on: ubuntu-22.04
needs: build-debian-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: debian
- name: Run build
run: docker-compose run --rm debian ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
translation-check:
name: Check for translatable strings
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: sudo apt-get update && sudo apt-get install qttools5-dev
- name: Test for modified translatable strings
run: ./tools/update-translation-files.sh ALL && git diff > apply_translations.patch
- name: Upload apply_translations.patch
uses: actions/upload-artifact@v4
with:
name: apply_translations.patch
path: apply_translations.patch
build-ubuntu:
name: Ubuntu LTS
runs-on: ubuntu-22.04
needs: build-ubuntu-lts-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: ubuntu_lts
- name: Run build
run: docker-compose run --rm ubuntu_lts ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
- name: Code coverage
run: |
# https://github.com/actions/runner/issues/491
if [ "${{ matrix.build_type }}" == "Release" ] && [ "${{ matrix.features }}" == "full" ]; then
docker-compose run --rm ubuntu_lts ./.ci-scripts/lcov.sh
# Upload report to codecov.io
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
fi
build-appimage:
name: Appimage
runs-on: ubuntu-22.04
needs: [build-ubuntu-for-appimage-docker, update-nightly-tag]
if: |
always() &&
needs.build-ubuntu-for-appimage-docker.result == 'success' &&
(needs.update-nightly-tag.result == 'success' ||
needs.update-nightly-tag.result == 'skipped')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: ubuntu_for_appimage
- name: Run build
run: docker-compose run --rm ubuntu_for_appimage ./appimage/build.sh --src-dir /qtox
- name: Upload appimage
uses: actions/upload-artifact@v4
with:
name: qTox-${{ github.sha }}.x86_64.AppImage
path: qTox-*.x86_64.AppImage
- name: Get tag name for appimage release file name
if: contains(github.ref, 'refs/tags/v')
id: get_version
run: |
VV=$(echo $GITHUB_REF | cut -d / -f 3)
echo "$VV"
echo "{VERSION}={$VV}" >> $GITHUB_OUTPUT
echo $GITHUB_OUTPUT
ls -al $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
# The zync file names MUST match the pattern "qTox-*.x86_64.AppImage.zsync"
# indefinitely for older versions to be able to update https://github.com/AppImage/AppImageSpec/blob/master/draft.md#github-releases
- name: Rename appimage for release upload
if: contains(github.ref, 'refs/tags/v')
run: |
echo $GITHUB_REF
VV=$(echo $GITHUB_REF | cut -d / -f 3)
cp -v qTox-*.x86_64.AppImage qTox-"$VV".x86_64.AppImage
sha256sum qTox-"$VV".x86_64.AppImage > qTox-"$VV".x86_64.AppImage.sha256
cp -v qTox-*.x86_64.AppImage.zsync qTox-"$VV".x86_64.AppImage.zsync
- name: Upload to versioned release
if: contains(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-v1.*.x86_64.AppImage,qTox-v1.*.x86_64.AppImage.sha256,qTox-v1.*.x86_64.AppImage.zsync"
- name: Rename artifact for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
run: |
cp -v qTox-*.x86_64.AppImage qTox-nightly.x86_64.AppImage
cp -v qTox-*.x86_64.AppImage.zsync qTox-nightly.x86_64.AppImage.zsync
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-nightly.x86_64.AppImage,qTox-nightly.x86_64.AppImage.zsync"
build-asan_appimage:
name: ASAN_Appimage
runs-on: ubuntu-22.04
needs: [build-ubuntu-for-asan-appimage-docker, update-nightly-tag]
if: |
always() &&
needs.build-ubuntu-for-asan-appimage-docker.result == 'success' &&
(needs.update-nightly-tag.result == 'success' ||
needs.update-nightly-tag.result == 'skipped')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: ubuntu_for_asan_appimage
- name: Run build
run: docker-compose run --rm ubuntu_for_asan_appimage ./appimage/asan_build.sh --src-dir /qtox
- name: Upload asan appimage
uses: actions/upload-artifact@v4
with:
name: qTox-asan-${{ github.sha }}.x86_64.AppImage
path: qTox-*.x86_64.AppImage
- name: Get tag name for appimage release file name
if: contains(github.ref, 'refs/tags/v')
id: get_version
run: |
VV=$(echo $GITHUB_REF | cut -d / -f 3)
echo "$VV"
echo "{VERSION}={$VV}" >> $GITHUB_OUTPUT
echo $GITHUB_OUTPUT
ls -al $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
# The zync file names MUST match the pattern "qTox-asan-*.x86_64.AppImage.zsync"
# indefinitely for older versions to be able to update https://github.com/AppImage/AppImageSpec/blob/master/draft.md#github-releases
- name: Rename appimage for release upload
if: contains(github.ref, 'refs/tags/v')
run: |
echo $GITHUB_REF
VV=$(echo $GITHUB_REF | cut -d / -f 3)
cp -v qTox-asan-*.x86_64.AppImage qTox-asan-"$VV".x86_64.AppImage
sha256sum qTox-asan-"$VV".x86_64.AppImage > qTox-asan-"$VV".x86_64.AppImage.sha256
cp -v qTox-asan-*.x86_64.AppImage.zsync qTox-asan-"$VV".x86_64.AppImage.zsync
- name: Upload to versioned release
if: contains(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-asan-v1.*.x86_64.AppImage,qTox-asan-v1.*.x86_64.AppImage.sha256,qTox-asan-v1.*.x86_64.AppImage.zsync"
- name: Rename artifact for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
run: |
cp -v qTox-asan-*.x86_64.AppImage qTox-asan-nightly.x86_64.AppImage
cp -v qTox-asan-*.x86_64.AppImage.zsync qTox-asan-nightly.x86_64.AppImage.zsync
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-asan-nightly.x86_64.AppImage,qTox-asan-nightly.x86_64.AppImage.zsync"
build-flatpak:
name: Flatpak
runs-on: ubuntu-22.04
needs: [build-flatpak-docker, update-nightly-tag]
if: |
always() &&
needs.build-flatpak-docker.result == 'success' &&
(needs.update-nightly-tag.result == 'success' ||
needs.update-nightly-tag.result == 'skipped')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: flatpak
- name: Run build
run: docker-compose run --rm flatpak ./flatpak/build.sh
- name: Upload flatpak
uses: actions/upload-artifact@v4
with:
name: qTox-${{ github.sha }}.x86_64.flatpak
path: qtox.flatpak
- name: Get tag name for flatpak release file name
if: contains(github.ref, 'refs/tags/v')
id: get_version
run: |
echo $GITHUB_REF
VV=$(echo $GITHUB_REF | cut -d / -f 3)
echo "$VV"
echo "{VERSION}={$VV}" >> $GITHUB_OUTPUT
echo $GITHUB_OUTPUT
- name: Rename flatpak for release upload
if: contains(github.ref, 'refs/tags/v')
run: |
echo $GITHUB_REF
VV=$(echo $GITHUB_REF | cut -d / -f 3)
cp -v qtox.flatpak qTox-"$VV".x86_64.flatpak
sha256sum qTox-"$VV".x86_64.flatpak > qTox-"$VV".x86_64.flatpak.sha256
- name: Upload to versioned release
if: contains(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-v1.*.x86_64.flatpak,qTox-v1.*.x86_64.flatpak.sha256"
- name: Rename artifact for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
run: |
cp -v qtox.flatpak qTox-nightly.flatpak
sha256sum qTox-nightly.flatpak > qTox-nightly.flatpak.sha256
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-nightly.flatpak,qTox-nightly.flatpak.sha256"
build-windows:
name: Windows
runs-on: ubuntu-22.04
needs: [update-nightly-tag]
if: |
always() &&
(needs.update-nightly-tag.result == 'success' ||
needs.update-nightly-tag.result == 'skipped')
permissions:
contents: write
strategy:
matrix:
build_type: [Release]
steps:
- uses: actions/checkout@v4
- name: build deps
run: sudo ./buildscripts/docker/nondocker_windows_builder.sh --src-dir /qtox
- name: build qtox
run: sudo ./windows/cross-compile/build.sh --arch x86_64 --build-type ${{ matrix.build_type }} --run-tests --src-dir /qtox
- name: Upload installer
if: matrix.build_type == 'release'
uses: actions/upload-artifact@v4
with:
name: setup-qtox-x86_64-${{ matrix.build_type }}.exe
path: package-prefix/setup-qtox.exe
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: qtox-x86_64-${{ matrix.build_type }}.zip
path: install-prefix/qtox-x86_64-${{ matrix.build_type }}.zip
- name: Rename exe for release upload
if: contains(github.ref, 'refs/tags/v') && matrix.build_type == 'release'
run: |
cp package-prefix/setup-qtox.exe setup-qtox-x86_64-release.exe
sha256sum setup-qtox-x86_64-release.exe > setup-qtox-x86_64-release.exe.sha256
- name: Upload to versioned release
if: contains(github.ref, 'refs/tags/v') && matrix.build_type == 'release'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "setup-qtox-x86_64-release.exe,setup-qtox-x86_64-release.exe.sha256"
- name: Rename zip for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
run: |
cp install-prefix/qtox-x86_64-${{ matrix.build_type }}.zip qtox-nightly-x86_64-${{ matrix.build_type }}.zip
sha256sum qtox-nightly-x86_64-${{ matrix.build_type }}.zip > qtox-nightly-x86_64-${{ matrix.build_type }}.zip.sha256
- name: Upload zip to nightly release
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qtox-nightly-x86_64-${{ matrix.build_type }}.zip,qtox-nightly-x86_64-${{ matrix.build_type }}.zip.sha256"
- name: Rename zip for release upload
if: contains(github.ref, 'refs/tags/v') && matrix.build_type == 'release'
run: |
pwd
ls -al install-prefix/
ls -al install-prefix/qtox-x86_64-${{ matrix.build_type }}.zip
cp install-prefix/qtox-x86_64-${{ matrix.build_type }}.zip qtox-x86_64.zip
sha256sum install-prefix/qtox-x86_64-${{ matrix.build_type }}.zip > qtox-x86_64.zip.sha256
- name: Upload zip to versioned release
if: contains(github.ref, 'refs/tags/v') && matrix.build_type == 'release'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qtox-x86_64.zip,qtox-x86_64.zip.sha256"
- name: Rename exe for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification' && matrix.build_type == 'release'
run: |
cp package-prefix/setup-qtox.exe qtox-nightly-x86_64-${{ matrix.build_type }}.exe
sha256sum qtox-nightly-x86_64-${{ matrix.build_type }}.exe > qtox-nightly-x86_64-${{ matrix.build_type }}.exe.sha256
- name: Upload exe to nightly release
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification' && matrix.build_type == 'release'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qtox-nightly-x86_64-${{ matrix.build_type }}.exe,qtox-nightly-x86_64-${{ matrix.build_type }}.exe.sha256"
build-osx-distributable:
name: macOS distributable
runs-on: macos-12
needs: update-nightly-tag
if: |
always() &&
(needs.update-nightly-tag.result == 'success' ||
needs.update-nightly-tag.result == 'skipped')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Homebrew dependencies to build dependencies
run: brew update || echo "some errors" ; echo "==111111111111==" ; brew bundle --file ./osx/Brewfile-DepBuildDeps || echo "some errors" ; echo "==222222222222==" ; brew upgrade || echo "some errors"
- name: Build dependencies
run: ./.ci-scripts/build-osx-deps.sh
- name: Build qTox
run: ./.ci-scripts/build-qtox-macos.sh dist
- name: Upload dmg
uses: actions/upload-artifact@v4
with:
name: qTox-${{ github.sha }}.dmg
path: qTox.dmg
- name: Create shasum for versioned release
if: contains(github.ref, 'refs/tags/v')
run: sha256sum qTox.dmg > qTox.dmg.sha256
- name: Upload to versioned release
if: contains(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox.dmg,qTox.dmg.sha256"
- name: Rename artifact for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
run: |
cp qTox.dmg qTox-nightly.dmg
sha256sum qTox-nightly.dmg > qTox-nightly.dmg.sha256
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/zoxcore/push_notification'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-nightly.dmg,qTox-nightly.dmg.sha256"