Skip to content

Commit

Permalink
Update of windows/linux install workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubMelka committed Jul 3, 2024
1 parent dc33087 commit 7df285b
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 83 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/LinuxInstall.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Linux_AppImage

on:
create:
push:
tags:
- 'v*'

Expand All @@ -18,6 +18,7 @@ jobs:
sudo apt-get install -y libxcb-cursor0
sudo apt-get install -y libspeechd2
sudo apt-get install -y gnupg2 wget
sudo apt-get install -y appstream
wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
Expand Down Expand Up @@ -106,6 +107,16 @@ jobs:
cmake --build build -j6
cmake --install build
- name: Read version
id: get_version
run: |
version=$(cat "pdf4qt/build/version.txt")
echo "Version: $version"
echo "appimagefilename=PDF4QT-$version-x86_64.AppImage" >> $GITHUB_ENV
echo "AppImage file name: PDF4QT-$version-x86_64.AppImage"
env:
appimagefilename: ${{ env.appimagefilename }}

- name: 'Linux Deploy Qt'
working-directory: pdf4qt/build
run: |
Expand All @@ -117,30 +128,30 @@ jobs:
- name: Sign and Repack AppImage
working-directory: pdf4qt/build
run: |
export GPG_TTY=$(tty)
echo "${{ secrets.PGP_PASSPHRASE }}" | appimagetool -s --sign-key "${{ secrets.PGP_KEY_ID }}" install/ io.github.JakubMelka.Pdf4qt.AppImage
appimagetool -s --sign-key "${{ secrets.PGP_KEY_ID }}" install/ ${{ env.appimagefilename }}
- name: Manual signature
run: |
gpg --batch --yes --verbose --pinentry-mode loopback --detach-sign --passphrase "${{ secrets.PGP_PASSPHRASE }}" --local-user "${{ secrets.PGP_KEY_ID }}" --output pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage.sig pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage
gpg --batch --yes --verbose --pinentry-mode loopback --detach-sign --passphrase "${{ secrets.PGP_PASSPHRASE }}" --local-user "${{ secrets.PGP_KEY_ID }}" --output pdf4qt/build/${{ env.appimagefilename }}.sig pdf4qt/build/${{ env.appimagefilename }}
- name: Verify AppImage Detached Signature
run: |
echo "${{ secrets.PGP_PUBLIC_KEY }}" | gpg --batch --import
gpg --verify pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage.sig pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage
gpg --verify pdf4qt/build/${{ env.appimagefilename }}.sig pdf4qt/build/${{ env.appimagefilename }}
- name: Upload AppImage Package
uses: actions/upload-artifact@v4
with:
name: ubuntu-appimage
path: ./pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage
name: ${{ env.appimagefilename }}
path: ./pdf4qt/build/${{ env.appimagefilename }}
retention-days: 30
compression-level: 0

- name: Upload AppImage Signature File
uses: actions/upload-artifact@v4
with:
name: ubuntu-appimage-sig
path: ./pdf4qt/build/io.github.JakubMelka.Pdf4qt.AppImage.sig
name: ${{ env.appimagefilename }}.sig
path: ./pdf4qt/build/${{ env.appimagefilename }}.sig
retention-days: 30
if-no-files-found: warn
compression-level: 0
120 changes: 97 additions & 23 deletions .github/workflows/WindowsInstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,40 @@ jobs:
uses: actions/checkout@v4
with:
path: pdf4qt


- name: Add MakeAppx to PATH
shell: pwsh
run: |
# Define the base path to Windows Kits
$basePath = "C:\Program Files (x86)\Windows Kits\10\bin"
# Get directories in the base path and sort them by version number
$sdkDirs = Get-ChildItem -Path $basePath -Directory | Sort-Object Name -Descending
# Find the first directory that contains the MakeAppx.exe
$sdkPath = $null
foreach ($dir in $sdkDirs) {
$path = Join-Path $dir.FullName "x64"
if (Test-Path (Join-Path $path "MakeAppx.exe")) {
$sdkPath = $path
break
}
}
# Add the highest version SDK path to the PATH environment variable
if ($sdkPath) {
Write-Host "Adding $sdkPath to PATH"
echo "PATH=$env:PATH;$sdkPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
Write-Error "MakeAppx.exe not found in any Windows SDK directories"
}
- name: Verify MakeAppx Path
shell: pwsh
run: |
$makeAppxPath = Get-Command MakeAppx.exe | Select-Object -ExpandProperty Definition
Write-Host "MakeAppx.exe found at: $makeAppxPath"
- name: 'VCPKG: Set up VCPKG'
run: |
git clone --depth=1 https://github.com/microsoft/vcpkg.git
Expand All @@ -39,7 +72,7 @@ jobs:

- name: 'VCPKG: Install project dependencies'
run: |
.\vcpkg install tbb openssl lcms zlib openjpeg freetype ijg-libjpeg libpng blend2d --triplet x64-windows
.\vcpkg install tbb openssl lcms zlib openjpeg freetype ijg-libjpeg libpng blend2d brotli bzip2 hwloc vcpkg-cmake vcpkg-cmake-config vcpkg-cmake-get-vars --triplet x64-windows
working-directory: vcpkg

- name: Install Qt
Expand All @@ -50,9 +83,33 @@ jobs:
target: 'desktop'
dir: '${{ github.workspace }}/qt/'
install-deps: 'true'
modules: 'qtspeech qtmultimedia'
modules: 'qtspeech qtmultimedia qtimageformats'
cache: 'true'
cache-key-prefix: ${{ runner.os }}-qt-672


- name: Find VC Redistributable Directories
shell: pwsh
run: |
# Define the base path to the VC redistributable directories
$basePath = "C:\Program Files\Microsoft Visual Studio\2022\*\VC\Redist\MSVC"
# Find directories that match the pattern for VC redistributables
$redistDirs = Get-ChildItem -Path $basePath -Recurse -Directory -Filter "Microsoft.VC*.CRT" | Where-Object { $_.FullName -notmatch "debug_nonredist" }
# Extract the toolset version from the directory names
if ($redistDirs) {
$firstRedistDir = $redistDirs | Select-Object -First 1
$toolsetVersion = $firstRedistDir.Name -replace '^Microsoft\.VC(\d+)\.CRT$', '$1'
Write-Host "Found MSVC Toolset Version: $toolsetVersion"
Write-Host "Found MSVC Redistributable Full Path: $firstRedistDir"
echo "MSVC_TOOLSET_VERSION=$toolsetVersion" >> $env:GITHUB_ENV
echo "VCToolsRedistDir=$($firstRedistDir.Parent.Parent.Parent.FullName)" >> $env:GITHUB_ENV
echo "VSCMD_ARG_TGT_ARCH=x64" >> $env:GITHUB_ENV
echo "MSVC_REDISTRIBUTABLES_PATH=$firstRedistDir" >> $env:GITHUB_ENV
} else {
Write-Error "No valid redistributable directories found."
}
- name: Build project
working-directory: pdf4qt
Expand All @@ -61,34 +118,51 @@ jobs:
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_VCPKG_BUILD_TYPE=Release -DPDF4QT_INSTALL_QT_DEPENDENCIES=ON -DPDF4QT_INSTALL_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE="${env:GITHUB_WORKSPACE}\vcpkg\scripts\buildsystems\vcpkg.cmake" -DPDF4QT_QT_ROOT="${env:Qt6_DIR}" -DPDF4QT_INSTALL_MSVC_REDISTRIBUTABLE=ON -DPDF4QT_INSTALL_PREPARE_WIX_INSTALLER=ON -DPDF4QT_INSTALL_TO_USR=ON
cmake --build build --config Release -j6
cmake --install build
env:
VCToolsRedistDir: ${{ env.VCToolsRedistDir }}
VSCMD_ARG_TGT_ARCH: ${{ env.VSCMD_ARG_TGT_ARCH }}
MSVC_TOOLSET_VERSION: ${{ env.MSVC_TOOLSET_VERSION }}
MSVC_REDISTRIBUTABLES_PATH: ${{ env.MSVC_REDISTRIBUTABLES_PATH }}

- name: Read version
id: get_version
shell: pwsh
run: |
version=$(cat ".\pdf4qt\build\version.txt")
echo "Version: $version"
echo "pdf4qt_version=$version" >> $GITHUB_ENV
env:
pdf4qt_version: ${{ env.pdf4qt_version }}

- name: Install WiX Toolset
run: choco install wix
- name: Create MSIX Package
$version = Get-Content -Path ".\pdf4qt\build\version.txt" -Raw
$version = $version.Trim() # Odstraní případné prázdné znaky kolem verze
Write-Host "Version: $version"
echo "pdf4qt_version=$version" >> $env:GITHUB_ENV
echo "msipackagefilename=JakubMelka.PDF4QT_${version}.msi" >> $env:GITHUB_ENV
Write-Host "MSI package file name: JakubMelka.PDF4QT_${version}.msi"
- name: Find WiXUIExtension.dll
id: find_wixui_extension
shell: pwsh
run: |
MakeAppx pack /d ".\pdf4qt\build\install\usr\bin" /p ".\pdf4qt\build\install\JakubMelka.PDF4QT_${{ env.pdf4qt_version }}.msix"
$wixPath = "C:\Program Files (x86)\WiX Toolset v3.*\bin\WiXUIExtension.dll"
$wixUIExtensionPath = Get-ChildItem -Path $wixPath -ErrorAction SilentlyContinue | Select-Object -First 1
if ($null -ne $wixUIExtensionPath) {
Write-Output "Found WiXUIExtension.dll at: $($wixUIExtensionPath.FullName)"
echo "wixuiextpath=$($wixUIExtensionPath.FullName)" >> $env:GITHUB_ENV
} else {
Write-Error "WiXUIExtension.dll not found in the expected path."
}

- name: Create MSI Package
working-directory: pdf4qt\WixInstaller
working-directory: pdf4qt\build\WixInstaller
run: |
candle -d"SolutionDir=." -d"SolutionExt=.sln" -d"SolutionFileName=PDF4QT.sln" -d"SolutionName=PDF4QT" -d"SolutionPath=PDF4QT.sln" -d"Configuration=Release" -d"OutDir=bin\Release\" -d"Platform=x86" -d"ProjectDir=." -d"ProjectExt=.wixproj" -d"ProjectFileName=PDF4QT.wixproj" -d"ProjectName=PDF4QT" -d"ProjectPath=PDF4QT.wixproj" -d"TargetDir=bin\Release\" -d"TargetExt=.msi" -d"TargetFileName=PDF4QT.msi" -d"TargetName=PDF4QT" -d"TargetPath=bin\Release\PDF4QT.msi" -out obj\Release\ -arch x86 -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixUIExtension.dll" Product.wxs
Light -out .\pdf4qt\build\install\PDF4QT.msi -pdbout .\bin\Release\PDF4QT.wixpdb -cultures:null -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixUIExtension.dll" -contentsfile obj\Release\PDF4QT.wixproj.BindContentsFileListnull.txt -outputsfile obj\Release\PDF4QT.wixproj.BindOutputsFileListnull.txt -builtoutputsfile obj\Release\PDF4QT.wixproj.BindBuiltOutputsFileListnull.txt -wixprojectfile .\PDF4QT.wixproj obj\Release\Product.wixobj
candle -v -d"SolutionDir=." -d"SolutionExt=.sln" -d"SolutionFileName=PDF4QT.sln" -d"SolutionName=PDF4QT" -d"SolutionPath=PDF4QT.sln" -d"Configuration=Release" -d"OutDir=bin\Release\" -d"Platform=x86" -d"ProjectDir=." -d"ProjectExt=.wixproj" -d"ProjectFileName=PDF4QT.wixproj" -d"ProjectName=PDF4QT" -d"ProjectPath=PDF4QT.wixproj" -d"TargetDir=bin\Release\" -d"TargetExt=.msi" -d"TargetFileName=${{ env.msipackagefilename }}" -d"TargetName=PDF4QT" -d"TargetPath=bin\Release\${{ env.msipackagefilename }}" -out obj\Release\ -arch x86 -ext "${{ env.wixuiextpath }}" Product.wxs
Light -v -out ${{ github.workspace }}\pdf4qt\build\install\${{ env.msipackagefilename }} -pdbout .\bin\Release\PDF4QT.wixpdb -cultures:null -ext "${{ env.wixuiextpath }}" -contentsfile obj\Release\PDF4QT.wixproj.BindContentsFileListnull.txt -outputsfile obj\Release\PDF4QT.wixproj.BindOutputsFileListnull.txt -builtoutputsfile obj\Release\PDF4QT.wixproj.BindBuiltOutputsFileListnull.txt -wixprojectfile .\PDF4QT.wixproj obj\Release\Product.wixobj
- name: Create MSIX Package
run: |
MakeAppx pack /d ".\pdf4qt\build\install\usr\bin" /p ".\pdf4qt\build\install\JakubMelka.PDF4QT_${{ env.pdf4qt_version }}.msix"
- name: Upload ZIP directory
uses: actions/upload-artifact@v4
with:
name: 'pdf4qt-${{ runner.os }}.zip'
name: 'PDF4QT-${{ runner.os }}-${{ env.pdf4qt_version }}.zip'
path: .\pdf4qt\build\install\usr\bin
retention-days: 30

Expand All @@ -102,6 +176,6 @@ jobs:
- name: Upload MSI package
uses: actions/upload-artifact@v4
with:
name: 'JakubMelka.PDF4QT_${{ env.pdf4qt_version }}.msi'
path: .\pdf4qt\build\install\PDF4QT.msi
name: '${{ env.msipackagefilename }}'
path: .\pdf4qt\build\install\${{ env.msipackagefilename }}
retention-days: 30
20 changes: 10 additions & 10 deletions AppxManifest.xml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="io.github.JakubMelka.PDF4QT" Publisher="CN=JakubMelka" Version="${PDF4QT_VERSION}.0" />
<Identity Name="io.github.JakubMelka.PDF4QT" Publisher="CN=Jakub Melka, O=Jakub Melka, L=Tursko, C=CZ" Version="${PDF4QT_VERSION}" />
<Properties>
<DisplayName>PDF4QT</DisplayName>
<PublisherDisplayName>Jakub Melka</PublisherDisplayName>
Expand Down Expand Up @@ -39,18 +39,18 @@
</Application>
<Application Id="Pdf4QtPageMaster" Executable="Pdf4QtPageMaster.exe" EntryPoint="windows.fullTrustApplication">
<uap:VisualElements DisplayName="PDF4QT PageMaster"
Description="Take control of your documents. Manage whole documents or individual pages with ease. Merge documents into a single file, or split them into multiple ones. You can also move, clone, or add pages with a few clicks, all within an intuitive user interface."
BackgroundColor="transparent"
Square150x150Logo="assets\150x150\io.github.JakubMelka.Pdf4qt.Pdf4QtPageMaster.png"
Square44x44Logo="assets\44x44\io.github.JakubMelka.Pdf4qt.Pdf4QtPageMaster.png">
Description="Take control of your documents. Manage whole documents or individual pages with ease. Merge documents into a single file, or split them into multiple ones. You can also move, clone, or add pages with a few clicks, all within an intuitive user interface."
BackgroundColor="transparent"
Square150x150Logo="assets\150x150\io.github.JakubMelka.Pdf4qt.Pdf4QtPageMaster.png"
Square44x44Logo="assets\44x44\io.github.JakubMelka.Pdf4qt.Pdf4QtPageMaster.png">
</uap:VisualElements>
</Application>
<Application Id="Pdf4QtDiff" Executable="Pdf4QtDiff.exe" EntryPoint="windows.fullTrustApplication">
<uap:VisualElements DisplayName="PDF4QT PageMaster"
Description="Spot differences effortlessly. This tool allows users to open two documents and receive a detailed list of differences. View these differences in a page-to-page window where they are clearly marked."
BackgroundColor="transparent"
Square150x150Logo="assets\150x150\io.github.JakubMelka.Pdf4qt.Pdf4QtDiff.png"
Square44x44Logo="assets\44x44\io.github.JakubMelka.Pdf4qt.Pdf4QtDiff.png">
<uap:VisualElements DisplayName="PDF4QT Diff"
Description="Spot differences effortlessly. This tool allows users to open two documents and receive a detailed list of differences. View these differences in a page-to-page window where they are clearly marked."
BackgroundColor="transparent"
Square150x150Logo="assets\150x150\io.github.JakubMelka.Pdf4qt.Pdf4QtDiff.png"
Square44x44Logo="assets\44x44\io.github.JakubMelka.Pdf4qt.Pdf4QtDiff.png">
</uap:VisualElements>
</Application>
</Applications>
Expand Down
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

cmake_minimum_required(VERSION 3.16)

set(PDF4QT_VERSION 1.4.0)
set(PDF4QT_VERSION 1.4.0.0)
message(STATUS "Build type - CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")

project(PDF4QT VERSION ${PDF4QT_VERSION} LANGUAGES CXX)
Expand Down Expand Up @@ -143,6 +143,8 @@ endif()
message("CMAKE_PREFIX_PATH = " ${CMAKE_PREFIX_PATH})
message("CMAKE_TOOLCHAIN_FILE = " ${CMAKE_TOOLCHAIN_FILE})

configure_file(version.txt.in version.txt)

if(NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY)
if(WIN32)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Desktop/44x44/
Expand Down Expand Up @@ -254,8 +256,13 @@ if(PDF4QT_INSTALL_DEPENDENCIES AND NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY)
endif()

if(WIN32 AND MSVC AND PDF4QT_INSTALL_MSVC_REDISTRIBUTABLE)
get_filename_component(MSVC_REDISTRIBUTABLES_PATH $ENV{VCToolsRedistDir}/$ENV{VSCMD_ARG_TGT_ARCH}/Microsoft.VC${MSVC_TOOLSET_VERSION}.CRT/ ABSOLUTE)
message(STATUS "MSVC Redistributable Package Path = ${MSVC_REDISTRIBUTABLES_PATH}")
if(DEFINED ENV{MSVC_REDISTRIBUTABLES_PATH})
set(MSVC_REDISTRIBUTABLES_PATH $ENV{MSVC_REDISTRIBUTABLES_PATH})
message(STATUS "Using existing MSVC Redistributable Package Path = ${MSVC_REDISTRIBUTABLES_PATH}")
else()
get_filename_component(MSVC_REDISTRIBUTABLES_PATH $ENV{VCToolsRedistDir}/$ENV{VSCMD_ARG_TGT_ARCH}/Microsoft.VC${MSVC_TOOLSET_VERSION}.CRT/ ABSOLUTE)
message(STATUS "MSVC Redistributable Package Path = ${MSVC_REDISTRIBUTABLES_PATH}")
endif()

install(DIRECTORY ${MSVC_REDISTRIBUTABLES_PATH}/
RUNTIME DESTINATION ${PDF4QT_INSTALL_LIB_DIR}/
Expand Down
15 changes: 6 additions & 9 deletions Desktop/io.github.JakubMelka.Pdf4qt.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<launchable type="desktop-id">io.github.JakubMelka.Pdf4qt.desktop</launchable>
<releases>
<release version="1.3.7" date="2024-01-10"/>
<release version="1.3.6" date="2023-11-24"/>
<release version="1.3.6" date="2023-11-24"/>
<release version="1.3.5" date="2023-09-08"/>
<release version="1.3.4" date="2023-08-03"/>
<release version="1.3.3" date="2023-04-22"/>
Expand All @@ -36,14 +36,11 @@
<release version="1.1.0" date="2021-12-19"/>
<release version="1.0.0" date="2021-09-19"/>
</releases>
<requires>
<internet>offline-only</internet>
</requires>
<screenshots>
<screenshot><caption>Browse PDF files easily and efficiently</caption>https://jakubmelka.github.io/assets/flatpak/profi-default.png</screenshot>
<screenshot><caption>Utilize the 'magnifying glass' feature to zoom in on specific sections of the page</caption>https://jakubmelka.github.io/assets/flatpak/profi-magnifier.png</screenshot>
<screenshot><caption>Display statistics for various content types within the PDF file</caption>https://jakubmelka.github.io/assets/flatpak/profi-object-statistics.png</screenshot>
<screenshot><caption>View the document details</caption>https://jakubmelka.github.io/assets/flatpak/profi-properties.png</screenshot>
<screenshot><caption>List of add-ons available for the PDF editor</caption>https://jakubmelka.github.io/assets/flatpak/profi-addons.png</screenshot>
<screenshot><caption>Browse PDF files easily and efficiently</caption><image>https://jakubmelka.github.io/assets/flatpak/profi-default.png</image></screenshot>
<screenshot><caption>Utilize the 'magnifying glass' feature to zoom in on specific sections of the page</caption><image>https://jakubmelka.github.io/assets/flatpak/profi-magnifier.png</image></screenshot>
<screenshot><caption>Display statistics for various content types within the PDF file</caption><image>https://jakubmelka.github.io/assets/flatpak/profi-object-statistics.png</image></screenshot>
<screenshot><caption>View the document details</caption><image>https://jakubmelka.github.io/assets/flatpak/profi-properties.png</image></screenshot>
<screenshot><caption>List of add-ons available for the PDF editor</caption><image>https://jakubmelka.github.io/assets/flatpak/profi-addons.png</image></screenshot>
</screenshots>
</component>
Loading

0 comments on commit 7df285b

Please sign in to comment.