diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd246f11..5670bfc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,43 +49,6 @@ jobs: git diff ${{ github.sha }} if [ "$(git diff ${{ github.sha }})" != "" ]; then exit 1; fi - # Linux build (Qt5 with unarr) - linux: - name: Linux (Qt5) - runs-on: ubuntu-22.04 - needs: [initialization, code-format-validation] - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y qtchooser qtbase5-dev-tools qt5-qmake \ - qtbase5-dev qtmultimedia5-dev libpoppler-qt5-dev qttools5-dev-tools \ - libqt5opengl5-dev libunarr-dev qtdeclarative5-dev libqt5svg5-dev qtquickcontrols2-5-dev - - - name: Create tarball - run: | - VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" - ./mktarball.sh $VERSION - mkdir tarball - cp yacreader-*-src.tar.xz* tarball/ - - - name: Build - run: | - export DEFINES_VAR=DEFINES+=\"BUILD_NUMBER=\\\\\\\"${{ needs.initialization.outputs.build_number }}\\\\\\\"\" - qmake CONFIG+="unarr" $DEFINES_VAR - make - - - name: Run tests - run: make check TESTARGS="-maxwarnings 100000" - - - name: Upload tarball - uses: actions/upload-artifact@v4 - with: - name: src-${{ needs.initialization.outputs.build_number }}-tarball - path: tarball/* - # Linux Qt6 build linux-qt6: name: Linux (Qt6) @@ -148,12 +111,12 @@ jobs: needs: [initialization, code-format-validation] steps: - uses: actions/checkout@v4 - + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' - + - name: Install dependencies run: | pip3 install --break-system-packages aqtinstall @@ -163,14 +126,14 @@ jobs: mkdir -p ${{ github.workspace }}/compressed_archive wget "https://github.com/YACReader/yacreader-7z-deps/blob/main/7z2301-src.7z?raw=true" -O ${{ github.workspace }}/compressed_archive/7z2301-src.7z 7z x ${{ github.workspace }}/compressed_archive/7z2301-src.7z -o${{ github.workspace }}/compressed_archive/lib7zip - + - 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" @@ -179,231 +142,25 @@ jobs: 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: Build and run tests run: | cd tests qmake make check TESTARGS="-maxwarnings 100000" - + - 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@v4 with: name: macos-qt6-universal-${{ needs.initialization.outputs.build_number }}-dmg path: "*.dmg" - # macOS Qt5 build - macos: - name: macOS (Qt5) - runs-on: macos-15-intel - needs: [initialization, code-format-validation] - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Install dependencies - run: | - brew install qt@5 - brew link qt@5 --force - npm install -g appdmg - mkdir -p ${{ github.workspace }}/compressed_archive - wget "https://github.com/YACReader/yacreader-7z-deps/blob/main/7z2301-src.7z?raw=true" -O ${{ github.workspace }}/compressed_archive/7z2301-src.7z - 7z x ${{ github.workspace }}/compressed_archive/7z2301-src.7z -o${{ github.workspace }}/compressed_archive/lib7zip - - - 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: "10.13" - run: | - VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" - SKIP_CODESIGN="${{ env.IS_FORK }}" - SKIP_CODESIGN=$(echo "$SKIP_CODESIGN" | tr '[:upper:]' '[:lower:]') - ./compileOSX.sh $VERSION ${{ needs.initialization.outputs.build_number }} $SKIP_CODESIGN Qt5 x86_64 - - - name: Build and run tests - run: | - cd tests - qmake - make check TESTARGS="-maxwarnings 100000" - - - 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@v4 - with: - name: macos-${{ needs.initialization.outputs.build_number }}-dmg - path: "*.dmg" - - # Windows x64 Qt5 build - windows-x64: - name: Windows x64 (Qt5) - runs-on: windows-2022 - needs: [initialization, code-format-validation] - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - 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 5.15.2 win64_msvc2019_64 -O c:\Qt - dir C:\Qt\5.15.2\msvc2019_64\bin - choco install -y wget - choco install innosetup - mkdir %GITHUB_WORKSPACE%\compressed_archive - wget "https://github.com/YACReader/yacreader-7z-deps/blob/main/7z2301-src.7z?raw=true" -O %GITHUB_WORKSPACE%\compressed_archive\7z2301-src.7z - 7z x %GITHUB_WORKSPACE%\compressed_archive\7z2301-src.7z -o%GITHUB_WORKSPACE%\compressed_archive\lib7zip - wget "https://aka.ms/vs/17/release/vc_redist.x64.exe" -O %GITHUB_WORKSPACE%\vc_redist.x64.exe - - - name: Build - shell: cmd - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH=C:\Qt\5.15.2\msvc2019_64\bin;%PATH% - set DEFINES_VAR=DEFINES+="BUILD_NUMBER=\\\\\\\"${{ needs.initialization.outputs.build_number }}\\\\\\\"" - qmake CONFIG+="7zip" %DEFINES_VAR% - nmake - - - name: Run tests - shell: cmd - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH=C:\Qt\5.15.2\msvc2019_64\bin;%PATH% - nmake check TESTARGS="-maxwarnings 100000" - - - name: Upload executables for signing - if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') - uses: actions/upload-artifact@v4 - id: upload_executables - with: - name: windows-x64-executables-unsigned-${{ needs.initialization.outputs.build_number }} - path: | - release64/YACReader.exe - release64/YACReaderLibrary.exe - release64/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: release64/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 "release64/signed" -Filter "*.exe" | ForEach-Object { - $destPath = "release64/$($_.Name)" - Write-Host "Moving signed: $($_.Name) -> $destPath" - Move-Item -Path $_.FullName -Destination $destPath -Force - Write-Host " Moved successfully" - } - Remove-Item -Path "release64/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\5.15.2\msvc2019_64\bin;%PATH% - .\create_installer.cmd x64 7z ${{ needs.initialization.outputs.build_number }} qt5 - - - 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@v4 - id: upload_unsigned - with: - name: windows-x64-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@v4 - with: - name: windows-x64-${{ needs.initialization.outputs.build_number }} - path: ci/win/Output/YACReader*.exe - # Windows x64 Qt6 build windows-x64-qt6: name: Windows x64 (Qt6) @@ -707,156 +464,6 @@ jobs: name: windows-arm64-qt6-${{ needs.initialization.outputs.build_number }} path: ci/win/Output/YACReader*.exe - # Windows x86 Qt5 build - windows-x86: - name: Windows x86 (Qt5) - runs-on: windows-2022 - needs: [initialization, code-format-validation] - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - 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 5.15.2 win32_msvc2019 -O c:\Qt - dir C:\Qt\5.15.2\msvc2019\bin - choco install -y wget - choco install innosetup - mkdir %GITHUB_WORKSPACE%\compressed_archive - wget "https://github.com/YACReader/yacreader-7z-deps/blob/main/7z2301-src.7z?raw=true" -O %GITHUB_WORKSPACE%\compressed_archive\7z2301-src.7z - 7z x %GITHUB_WORKSPACE%\compressed_archive\7z2301-src.7z -o%GITHUB_WORKSPACE%\compressed_archive\lib7zip - wget "https://aka.ms/vs/17/release/vc_redist.x86.exe" -O %GITHUB_WORKSPACE%\vc_redist.x86.exe - - - name: Build - shell: cmd - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" - set PATH=C:\Qt\5.15.2\msvc2019\bin;%PATH% - set DEFINES_VAR=DEFINES+="BUILD_NUMBER=\\\\\\\"${{ needs.initialization.outputs.build_number }}\\\\\\\"" - qmake CONFIG+="7zip" %DEFINES_VAR% - nmake - - - name: Run tests - shell: cmd - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" - set PATH=C:\Qt\5.15.2\msvc2019\bin;%PATH% - nmake check TESTARGS="-maxwarnings 100000" - - - name: Upload executables for signing - if: github.repository == 'YACReader/yacreader' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') - uses: actions/upload-artifact@v4 - id: upload_executables - with: - name: windows-x86-executables-unsigned-${{ needs.initialization.outputs.build_number }} - path: | - release/YACReader.exe - release/YACReaderLibrary.exe - release/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: release/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 "release/signed" -Filter "*.exe" | ForEach-Object { - $destPath = "release/$($_.Name)" - Write-Host "Moving signed: $($_.Name) -> $destPath" - Move-Item -Path $_.FullName -Destination $destPath -Force - Write-Host " Moved successfully" - } - Remove-Item -Path "release/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\vcvars32.bat" - set PATH=C:\Qt\5.15.2\msvc2019\bin;%PATH% - .\create_installer.cmd x86 7z ${{ needs.initialization.outputs.build_number }} qt5 - - - 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@v4 - id: upload_unsigned - with: - name: windows-x86-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@v4 - with: - name: windows-x86-${{ needs.initialization.outputs.build_number }} - path: ci/win/Output/YACReader*.exe - # Docker amd64 build docker-amd64: name: Docker amd64 Image @@ -907,13 +514,9 @@ jobs: runs-on: ubuntu-24.04 needs: - initialization - - linux - linux-qt6 - linux-qt6-7zip - - macos - macos-qt6-universal - - windows-x86 - - windows-x64 - windows-x64-qt6 - windows-arm64-qt6 - docker-amd64 @@ -1021,13 +624,9 @@ jobs: runs-on: ubuntu-24.04 needs: - initialization - - linux - linux-qt6 - linux-qt6-7zip - - macos - macos-qt6-universal - - windows-x86 - - windows-x64 - windows-x64-qt6 - windows-arm64-qt6 - docker-amd64