-
Notifications
You must be signed in to change notification settings - Fork 113
687 lines (601 loc) · 26.8 KB
/
Copy pathbuild.yml
File metadata and controls
687 lines (601 loc) · 26.8 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
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
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
name: Build
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
env:
IS_ORIGINAL_REPO: ${{ github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') }}
IS_FORK: ${{ github.repository != 'YACReader/yacreader' || (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop') }}
jobs:
# Build number generation
initialization:
name: Initialization
runs-on: windows-latest
outputs:
build_number: ${{ steps.build_number.outputs.build_number }}
steps:
- name: Generate Build Number
id: build_number
shell: pwsh
run: |
$date = (Get-Date).ToString("yyMMdd")
$revision = "${{ github.run_number }}"
$buildNumber = "$date$revision"
echo "build_number=$buildNumber" >> $env:GITHUB_OUTPUT
echo "Build Number: $buildNumber"
# Code format validation
code-format-validation:
name: Code Format Validation
runs-on: macos-latest
needs: initialization
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: brew install clang-format
- name: Print clang-format version
run: clang-format --version
- name: Run clang-format
run: |
find . \( -name '*.h' -or -name '*.cpp' -or -name '*.c' -or -name '*.mm' -or -name '*.m' \) -print0 | xargs -0 clang-format -style=file -i
git diff ${{ github.sha }}
if [ "$(git diff ${{ github.sha }})" != "" ]; then exit 1; fi
# Source tarball
source-tarball:
name: Source Tarball
runs-on: ubuntu-24.04
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Create tarball
run: |
VERSION="$(tr -d '\r\n' < VERSION)"
./mktarball.sh "$VERSION"
mkdir tarball
cp yacreader-*-src.tar.xz* tarball/
- name: Upload tarball
uses: actions/upload-artifact@v6
with:
name: src-${{ needs.initialization.outputs.build_number }}-tarball
path: tarball/*
# Linux Qt6 build
linux-qt6:
name: Linux (Qt6)
runs-on: ubuntu-24.04
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libunarr-dev libgl-dev libgles2-mesa-dev \
libfontconfig1-dev libfreetype-dev libxkbcommon-dev libpoppler-qt6-dev \
libspeechd-dev
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.9.3'
modules: 'qt5compat qtmultimedia qtimageformats qtshadertools qtspeech'
cache: true
- name: Build
run: |
cmake -B build \
-DDECOMPRESSION_BACKEND=unarr \
-DPDF_BACKEND=poppler \
-DBUILD_NUMBER="${{ needs.initialization.outputs.build_number }}" \
-DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel 2
- name: Run tests
run: ctest --test-dir build --output-on-failure
# Linux Qt6 with 7zip
linux-qt6-7zip:
name: Linux (Qt6 + 7zip)
runs-on: ubuntu-24.04
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl-dev libgles2-mesa-dev \
libfontconfig1-dev libfreetype-dev libxkbcommon-dev libpoppler-qt6-dev \
libspeechd-dev
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.9.3'
modules: 'qt5compat qtmultimedia qtimageformats qtshadertools qtspeech'
cache: true
- name: Build
run: |
cmake -B build \
-DDECOMPRESSION_BACKEND=7zip \
-DPDF_BACKEND=poppler \
-DBUILD_NUMBER="${{ needs.initialization.outputs.build_number }}" \
-DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel 2
- name: Run tests
run: ctest --test-dir build --output-on-failure
# macOS Qt6 Universal build
macos-qt6-universal:
name: macOS (Qt6 Universal)
runs-on: macos-15
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '18'
- name: Install dependencies
run: |
pip3 install --break-system-packages aqtinstall
python3 -m aqt install-qt mac desktop 6.9.3 -m qt5compat qtmultimedia qtimageformats qtshadertools qtspeech
echo "${{ github.workspace }}/6.9.3/macos/bin" >> $GITHUB_PATH
npm install -g appdmg
- name: Import Code Signing Certificate
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
- name: Build
env:
MACOSX_DEPLOYMENT_TARGET: "11"
run: |
VERSION="$(tr -d '\r\n' < VERSION)"
SKIP_CODESIGN="${{ env.IS_FORK }}"
SKIP_CODESIGN=$(echo "$SKIP_CODESIGN" | tr '[:upper:]' '[:lower:]')
./compileOSX.sh $VERSION ${{ needs.initialization.outputs.build_number }} $SKIP_CODESIGN Qt6 universal
- name: Run tests
run: ctest --test-dir build --output-on-failure
- name: Notarize
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
run: |
xcrun notarytool submit *.dmg --apple-id "${{ secrets.MACOS_APPLE_ID }}" --team-id "${{ secrets.MACOS_TEAM_ID }}" --password "${{ secrets.MACOS_APP_PASSWORD }}" --wait
xcrun stapler staple *.dmg
- name: Upload DMG
uses: actions/upload-artifact@v6
with:
name: macos-qt6-universal-${{ needs.initialization.outputs.build_number }}-dmg
path: "*.dmg"
# Windows x64 Qt6 build
windows-x64-qt6:
name: Windows x64 (Qt6)
runs-on: windows-2022
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
architecture: 'x64'
- name: Install dependencies
shell: cmd
run: |
pip install -U pip
pip install aqtinstall
mkdir C:\Qt
python -m aqt install-qt windows desktop 6.9.3 win64_msvc2022_64 -O c:\Qt -m qt5compat qtmultimedia qtimageformats qtshadertools qtspeech
dir C:\Qt\6.9.3\msvc2022_64\bin
curl.exe -L --retry 5 --retry-delay 5 --retry-all-errors "https://aka.ms/vs/17/release/vc_redist.x64.exe" -o "%GITHUB_WORKSPACE%\vc_redist.x64.exe"
where iscc
- name: Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set PATH=C:\Qt\6.9.3\msvc2022_64\bin;%PATH%
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DDECOMPRESSION_BACKEND=7zip -DPDF_BACKEND=pdfium -DBUILD_NUMBER="${{ needs.initialization.outputs.build_number }}" -DCMAKE_PREFIX_PATH=C:\Qt\6.9.3\msvc2022_64
cmake --build build --parallel
- name: Run tests
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set PATH=C:\Qt\6.9.3\msvc2022_64\bin;%PATH%
ctest --test-dir build --output-on-failure
- name: Upload executables for signing
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: actions/upload-artifact@v6
id: upload_executables
with:
name: windows-x64-qt6-executables-unsigned-${{ needs.initialization.outputs.build_number }}
path: |
build/bin/YACReader.exe
build/bin/YACReaderLibrary.exe
build/bin/YACReaderLibraryServer.exe
- name: Sign executables with SignPath
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
project-slug: 'yacreader'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'zipped-files'
github-artifact-id: ${{ steps.upload_executables.outputs.artifact-id }}
wait-for-completion: true
wait-for-completion-timeout-in-seconds: "7200"
output-artifact-directory: build/bin/signed
- name: Replace with signed executables
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
shell: pwsh
run: |
Write-Host "=== Replacing executables with signed versions ==="
Get-ChildItem -Path "build/bin/signed" -Filter "*.exe" | ForEach-Object {
$destPath = "build/bin/$($_.Name)"
Write-Host "Moving signed: $($_.Name) -> $destPath"
Move-Item -Path $_.FullName -Destination $destPath -Force
Write-Host " Moved successfully"
}
Remove-Item -Path "build/bin/signed" -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "Signed executables are ready for installer creation"
- name: Create installer
shell: cmd
working-directory: ci/win
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set PATH=C:\Qt\6.9.3\msvc2022_64\bin;%PATH%
.\create_installer.cmd x64 7z ${{ needs.initialization.outputs.build_number }}
- name: Verify installer was created
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
shell: pwsh
run: |
if (-not (Test-Path "ci/win/Output/YACReader*.exe")) {
throw "Installer file was not created"
}
Get-ChildItem "ci/win/Output/YACReader*.exe"
- name: Upload unsigned installer
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: actions/upload-artifact@v6
id: upload_unsigned
with:
name: windows-x64-qt6-unsigned-${{ needs.initialization.outputs.build_number }}
path: ci/win/Output/YACReader*.exe
- name: Submit to SignPath
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
project-slug: 'yacreader'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'zipped-files'
github-artifact-id: ${{ steps.upload_unsigned.outputs.artifact-id }}
wait-for-completion: true
wait-for-completion-timeout-in-seconds: "7200"
output-artifact-directory: ci/win/Output/signed
- name: Replace with signed installer
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
shell: pwsh
run: |
Write-Host "=== Files in signed directory before move ==="
Get-ChildItem -Path "ci/win/Output/signed" -Filter "*.exe" | ForEach-Object { Write-Host " $($_.Name) - $($_.Length) bytes" }
$signedFiles = Get-ChildItem -Path "ci/win/Output/signed" -Filter "*.exe"
foreach ($signedFile in $signedFiles) {
$destPath = "ci/win/Output/$($signedFile.Name)"
Write-Host "Moving signed: $($signedFile.Name) -> $destPath"
Move-Item -Path $signedFile.FullName -Destination $destPath -Force
Write-Host " Moved successfully"
}
Write-Host "=== Files in Output directory after move ==="
Get-ChildItem -Path "ci/win/Output" -Filter "*.exe" | ForEach-Object { Write-Host " $($_.Name) - $($_.Length) bytes" }
Remove-Item -Path "ci/win/Output/signed" -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "Cleaned up signed directory"
- name: Upload installer
uses: actions/upload-artifact@v6
with:
name: windows-x64-qt6-${{ needs.initialization.outputs.build_number }}
path: ci/win/Output/YACReader*.exe
# Windows ARM64 Qt6 build
windows-arm64-qt6:
name: Windows ARM64 (Qt6)
runs-on: windows-2022
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
architecture: 'x64'
- name: Install dependencies
shell: cmd
run: |
pip install aqtinstall
mkdir C:\Qt
python -m aqt install-qt windows desktop 6.9.3 win64_msvc2022_64 -O c:\Qt -m qt5compat qtmultimedia qtimageformats qtshadertools qtspeech
python -m aqt install-qt windows desktop 6.9.3 win64_msvc2022_arm64_cross_compiled -O c:\Qt -m qt5compat qtmultimedia qtimageformats qtshadertools qtspeech
dir C:\Qt\6.9.3\msvc2022_arm64\bin
curl.exe -L --retry 5 --retry-delay 5 --retry-all-errors "https://aka.ms/vs/17/release/vc_redist.arm64.exe" -o "%GITHUB_WORKSPACE%\vc_redist.arm64.exe"
where iscc
- name: Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64
set PATH=C:\Qt\6.9.3\msvc2022_arm64\bin;%PATH%
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DDECOMPRESSION_BACKEND=7zip -DPDF_BACKEND=pdfium -DBUILD_NUMBER="${{ needs.initialization.outputs.build_number }}" -DCMAKE_PREFIX_PATH=C:\Qt\6.9.3\msvc2022_arm64 -DQT_HOST_PATH=C:\Qt\6.9.3\msvc2022_64 -DCMAKE_SYSTEM_PROCESSOR=ARM64
cmake --build build --parallel
- name: Upload executables for signing
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: actions/upload-artifact@v6
id: upload_executables
with:
name: windows-arm64-qt6-executables-unsigned-${{ needs.initialization.outputs.build_number }}
path: |
build/bin/YACReader.exe
build/bin/YACReaderLibrary.exe
build/bin/YACReaderLibraryServer.exe
- name: Submit to SignPath
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
project-slug: 'yacreader'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'zipped-files'
github-artifact-id: ${{ steps.upload_executables.outputs.artifact-id }}
wait-for-completion: true
wait-for-completion-timeout-in-seconds: "7200"
output-artifact-directory: 'build/bin/signed'
- name: Replace executables with signed versions
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
shell: pwsh
run: |
Copy-Item "build/bin/signed/YACReader.exe" "build/bin/YACReader.exe" -Force
Copy-Item "build/bin/signed/YACReaderLibrary.exe" "build/bin/YACReaderLibrary.exe" -Force
Copy-Item "build/bin/signed/YACReaderLibraryServer.exe" "build/bin/YACReaderLibraryServer.exe" -Force
Remove-Item -Path "build/bin/signed" -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "Signed executables are ready for installer creation"
- name: Create installer
shell: cmd
working-directory: ci/win
run: |
rem The ARM64 cross package's own tools cannot run on the x64 runner, so use
rem the host x64 windeployqt but point it at the ARM64 Qt via qtpaths,
rem otherwise it deploys x64 Qt DLLs and the app dies with 0xc000007b on ARM.
if not exist C:\Qt\6.9.3\msvc2022_arm64\bin\qtpaths.bat (
echo qtpaths.bat not found in the ARM64 Qt package & exit /b 1
)
set PATH=C:\Qt\6.9.3\msvc2022_64\bin;%PATH%
set WINDEPLOYQT_EXTRA_ARGS=--qtpaths C:\Qt\6.9.3\msvc2022_arm64\bin\qtpaths.bat
.\create_installer.cmd arm64 7z ${{ needs.initialization.outputs.build_number }}
- name: Verify deployed binaries are ARM64
shell: pwsh
working-directory: ci/win
run: |
$bad = @()
Get-ChildItem -Path installer_contents -Recurse -Include *.dll, *.exe |
Where-Object { $_.Name -notlike 'vc_redist*' } |
ForEach-Object {
$fs = [System.IO.File]::OpenRead($_.FullName)
try {
$br = New-Object System.IO.BinaryReader($fs)
$null = $fs.Seek(0x3C, 'Begin')
$peOffset = $br.ReadInt32()
$null = $fs.Seek($peOffset + 4, 'Begin')
$machine = $br.ReadUInt16()
} finally { $fs.Close() }
if ($machine -ne 0xAA64) {
$bad += ('{0} (machine: 0x{1:X4})' -f $_.FullName, $machine)
}
}
if ($bad.Count -gt 0) {
$bad | ForEach-Object { Write-Host "Not ARM64: $_" }
throw "$($bad.Count) non-ARM64 binaries found in installer contents"
}
Write-Host "All deployed DLLs/EXEs are ARM64"
- name: Verify installer was created
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
shell: pwsh
run: |
if (-not (Test-Path "ci/win/Output/YACReader*.exe")) {
throw "Installer file was not created"
}
Get-ChildItem "ci/win/Output/YACReader*.exe"
- name: Upload unsigned installer
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: actions/upload-artifact@v6
id: upload_unsigned
with:
name: windows-arm64-qt6-unsigned-${{ needs.initialization.outputs.build_number }}
path: ci/win/Output/YACReader*.exe
- name: Submit to SignPath
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
project-slug: 'yacreader'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'zipped-files'
github-artifact-id: ${{ steps.upload_unsigned.outputs.artifact-id }}
wait-for-completion: true
wait-for-completion-timeout-in-seconds: "7200"
output-artifact-directory: 'ci/win/Output/signed'
- name: Replace with signed installer and cleanup
if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
shell: pwsh
working-directory: ci/win/Output
run: |
$signedFiles = Get-ChildItem "signed/YACReader*.exe"
foreach ($file in $signedFiles) {
$destName = $file.Name
Copy-Item $file.FullName $destName -Force
Write-Host "Replaced with signed: $destName"
}
Remove-Item -Path "signed" -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "Cleaned up signed directory"
- name: Upload installer
uses: actions/upload-artifact@v6
with:
name: windows-arm64-qt6-${{ needs.initialization.outputs.build_number }}
path: ci/win/Output/YACReader*.exe
# Docker amd64 build
docker-amd64:
name: Docker amd64 Image
runs-on: ubuntu-latest
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build amd64 Image
working-directory: docker
run: |
docker build --no-cache --platform linux/amd64 -f Dockerfile \
--build-arg YACR_REPOSITORY=${{ github.event.pull_request.head.repo.clone_url || format('https://github.com/{0}.git', github.repository) }} \
--build-arg YACR_VERSION=${{ github.event.pull_request.head.sha || github.sha }} \
-t yacreader/yacreaderlibraryserver:develop-amd64 .
docker save yacreader/yacreaderlibraryserver:develop-amd64 -o amd64.tar
- name: Upload Docker Image
uses: actions/upload-artifact@v6
with:
name: docker-amd64
path: docker/amd64.tar
# Docker arm64 build (native)
docker-arm64:
name: Docker arm64 Image
runs-on: ubuntu-24.04-arm
needs: [initialization, code-format-validation]
steps:
- uses: actions/checkout@v6
- name: Build arm64 Image (native)
working-directory: docker
run: |
docker build --no-cache --platform linux/arm64 -f Dockerfile \
--build-arg YACR_REPOSITORY=${{ github.event.pull_request.head.repo.clone_url || format('https://github.com/{0}.git', github.repository) }} \
--build-arg YACR_VERSION=${{ github.event.pull_request.head.sha || github.sha }} \
-t yacreader/yacreaderlibraryserver:develop-arm64 .
docker save yacreader/yacreaderlibraryserver:develop-arm64 -o arm64.tar
- name: Upload Docker Image
uses: actions/upload-artifact@v6
with:
name: docker-arm64
path: docker/arm64.tar
# Publish dev builds
publish-dev-builds:
name: Publish Dev Builds
if: github.repository == 'YACReader/yacreader' && github.ref == 'refs/heads/develop'
runs-on: ubuntu-24.04
needs:
- initialization
- source-tarball
- linux-qt6
- linux-qt6-7zip
- macos-qt6-universal
- windows-x64-qt6
- windows-arm64-qt6
- docker-amd64
- docker-arm64
steps:
- uses: actions/checkout@v6
- name: Prepare release artifacts
uses: ./.github/actions/prepare-release-artifacts
- name: Get version
id: version
run: |
VERSION="$(tr -d '\r\n' < VERSION).${{ needs.initialization.outputs.build_number }}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Extract release notes
id: release_notes
uses: ./.github/actions/extract-release-notes
with:
version: ${{ steps.version.outputs.version }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Push Docker Images
run: |
for arch in amd64 arm64; do
docker load -i staging/${arch}.tar
docker push yacreader/yacreaderlibraryserver:develop-${arch}
rm staging/${arch}.tar
done
docker buildx imagetools create \
-t yacreader/yacreaderlibraryserver:develop \
yacreader/yacreaderlibraryserver:develop-amd64 \
yacreader/yacreaderlibraryserver:develop-arm64
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
repository: YACReader/yacreader-dev-builds
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
body: ${{ steps.release_notes.outputs.notes }}
target_commitish: 25313e3d4d03fcbe44d3943db23bc03bbd1a5205
files: staging/*
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
# Publish release builds
publish-release:
name: Publish Release
if: github.repository == 'YACReader/yacreader' && github.ref == 'refs/heads/master'
runs-on: ubuntu-24.04
needs:
- initialization
- source-tarball
- linux-qt6
- linux-qt6-7zip
- macos-qt6-universal
- windows-x64-qt6
- windows-arm64-qt6
- docker-amd64
- docker-arm64
steps:
- uses: actions/checkout@v6
- name: Prepare release artifacts
uses: ./.github/actions/prepare-release-artifacts
- name: Get version
id: version
run: |
VERSION="$(tr -d '\r\n' < VERSION)"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Extract release notes
id: release_notes
uses: ./.github/actions/extract-release-notes
with:
version: ${{ steps.version.outputs.version }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Push Docker Images
run: |
for arch in amd64 arm64; do
docker load -i staging/${arch}.tar
docker tag yacreader/yacreaderlibraryserver:develop-${arch} yacreader/yacreaderlibraryserver:latest-${arch}
docker push yacreader/yacreaderlibraryserver:latest-${arch}
rm staging/${arch}.tar
done
docker buildx imagetools create \
-t yacreader/yacreaderlibraryserver:latest \
yacreader/yacreaderlibraryserver:latest-amd64 \
yacreader/yacreaderlibraryserver:latest-arm64
docker buildx imagetools create \
-t yacreader/yacreaderlibraryserver:${{ steps.version.outputs.version }} \
yacreader/yacreaderlibraryserver:latest-amd64 \
yacreader/yacreaderlibraryserver:latest-arm64
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
body: ${{ steps.release_notes.outputs.notes }}
files: staging/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}