Add funtion to open the library root location #265
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} | |