diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 044c0046..5112167f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: uses: actions/checkout@v4 - name: Install Qt - uses: jurplel/install-qt-action@v4 + uses: jdpurcell/install-qt-action@v4 with: version: ${{ matrix.qtVersion }} arch: ${{ matrix.qtArch }} @@ -90,7 +90,7 @@ jobs: bash dist/scripts/linuxdeployqt.sh ${{ env.buildNumString }} } - - name: 'Upload Artifact' + - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: qView-JDP${{ env.buildNumString != '' && '-' || '' }}${{ env.buildNumString }}-${{ runner.os }}${{ matrix.osSuffix }} diff --git a/dist/scripts/build.ps1 b/dist/scripts/build.ps1 index 1b195640..8c3c6e65 100755 --- a/dist/scripts/build.ps1 +++ b/dist/scripts/build.ps1 @@ -4,8 +4,8 @@ param ( $Prefix = "/usr" ) -$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3] -Write-Host "Detected Qt Version $qtVersion" +$qtVersion = [version](qmake -query QT_VERSION) +Write-Host "Detected Qt version $qtVersion" if ($IsWindows) { dist/scripts/vcvars.ps1 diff --git a/dist/scripts/download-plugins.ps1 b/dist/scripts/download-plugins.ps1 index dfc83cad..23ddaaa6 100755 --- a/dist/scripts/download-plugins.ps1 +++ b/dist/scripts/download-plugins.ps1 @@ -2,8 +2,8 @@ # This script will download binary plugins from the kimageformats-binaries repository using Github's API. -$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3] -Write-Host "Detected Qt Version $qtVersion" +$qtVersion = [version](qmake -query QT_VERSION) +Write-Host "Detected Qt version $qtVersion" $osName = $IsWindows ? 'Windows' : @@ -67,7 +67,7 @@ if ($pluginNames -contains 'KImageFormats') { $kfMajorVer = $qtVersion -ge [version]'6.5.0' ? 6 : 5 if ($IsWindows) { mv KImageFormats/KImageFormats/output/kimg_*.dll "$out_imf/" - CopyFrameworkDlls "KF$($kfMajorVer)Archive.dll" @("zlib1.dll") + CopyFrameworkDlls "KF${kfMajorVer}Archive.dll" @("zlib1.dll") CopyFrameworkDlls "avif.dll" @("dav1d.dll", "jpeg62.dll", "libyuv.dll") CopyFrameworkDlls "heif.dll" @("libde265.dll") CopyFrameworkDlls "raw.dll" @("lcms2.dll", "zlib1.dll") diff --git a/dist/scripts/innomake.ps1 b/dist/scripts/innomake.ps1 index f7e784ff..f0ac6416 100755 --- a/dist/scripts/innomake.ps1 +++ b/dist/scripts/innomake.ps1 @@ -9,4 +9,4 @@ if (-not $suffix) { New-Item -Path "dist\win\qView-Win$suffix" -ItemType Directory -ea 0 copy -R bin\* "dist\win\qView-Win$suffix" iscc dist\win\qView$suffix.iss -copy dist\win\Output\* bin\ \ No newline at end of file +copy dist\win\Output\* bin\ diff --git a/dist/scripts/macdeploy.sh b/dist/scripts/macdeploy.sh index 7e884a97..65555784 100755 --- a/dist/scripts/macdeploy.sh +++ b/dist/scripts/macdeploy.sh @@ -1,10 +1,8 @@ #!/usr/bin/bash -if [[ -n "$1" ]]; then - VERSION=$0 -else - VERSION=$(LC_ALL=C sed -n -e '/^VERSION/p' qView.pro) - VERSION=${VERSION: -3} +if [[ -z "$1" ]]; then + RELEASE_VER=$(LC_ALL=C sed -n -e '/^VERSION/p' qView.pro) + RELEASE_VER=${RELEASE_VER: -3} fi if [[ -n "$APPLE_DEVID_APP_CERT_DATA" ]]; then @@ -61,9 +59,9 @@ if [[ -n "$1" ]]; then hdiutil convert "qView.sparsebundle" -format ULFO -o "$DMG_FILENAME" rm -r qView.sparsebundle else - DMG_FILENAME=qView-JDP-$VERSION.dmg + DMG_FILENAME=qView-JDP-$RELEASE_VER.dmg brew install create-dmg - create-dmg --volname "qView-JDP $VERSION" --filesystem APFS --format ULFO --window-size 660 400 --icon-size 160 --icon "qView.app" 180 170 --hide-extension qView.app --app-drop-link 480 170 "$DMG_FILENAME" "qView.app" + create-dmg --volname "qView-JDP $RELEASE_VER" --filesystem APFS --format ULFO --window-size 660 400 --icon-size 160 --icon "qView.app" 180 170 --hide-extension qView.app --app-drop-link 480 170 "$DMG_FILENAME" "qView.app" fi if [[ "$APPLE_NOTARIZE_REQUESTED" == "true" ]]; then codesign --sign "$CODESIGN_CERT_NAME" --timestamp --identifier "$APP_IDENTIFIER.dmg" "$DMG_FILENAME" diff --git a/dist/scripts/vcvars.ps1 b/dist/scripts/vcvars.ps1 index 192d061c..d0eb30c2 100755 --- a/dist/scripts/vcvars.ps1 +++ b/dist/scripts/vcvars.ps1 @@ -4,22 +4,19 @@ if ([RuntimeInformation]::OSArchitecture -ne [Architecture]::X64) { throw 'Unsupported host architecture.' } -$arch = +$argArch = $env:buildArch -eq 'X64' ? 'x64' : $env:buildArch -eq 'X86' ? 'x64_x86' : $env:buildArch -eq 'Arm64' ? 'x64_arm64' : $null -if (-not $arch) { +if (-not $argArch) { throw 'Unsupported build architecture.' } - -$path = Resolve-Path "${env:ProgramFiles}\Microsoft Visual Studio\*\*\VC\Auxiliary\Build" | Select-Object -ExpandProperty Path - -cmd.exe /c "call `"$path\vcvarsall.bat`" $arch && set > %temp%\vcvars.txt" - +$vsDir = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath $exclusions = @('VCPKG_ROOT') -Get-Content "$env:temp\vcvars.txt" | Foreach-Object { - if ($_ -match "^(.*?)=(.*)$" -and $matches[1] -notin $exclusions) { - [Environment]::SetEnvironmentVariable($matches[1], $matches[2]) +cmd /c "`"$(Join-Path $vsDir 'VC\Auxiliary\Build\vcvarsall.bat')`" $argArch > null && set" | ForEach-Object { + $name, $value = $_ -Split '=', 2 + if ($name -notin $exclusions) { + [Environment]::SetEnvironmentVariable($name, $value) } } diff --git a/dist/scripts/windeployqt.ps1 b/dist/scripts/windeployqt.ps1 index 2de273f6..3ac2971f 100755 --- a/dist/scripts/windeployqt.ps1 +++ b/dist/scripts/windeployqt.ps1 @@ -2,12 +2,8 @@ param ( $NightlyVersion = "" ) -$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3] -Write-Host "Detected Qt Version $qtVersion" - -if ($env:buildArch -eq 'Arm64') { - $env:QT_HOST_PATH = [System.IO.Path]::GetFullPath("$env:QT_ROOT_DIR\..\$((Split-Path -Path $env:QT_ROOT_DIR -Leaf) -replace '_arm64', '_64')") -} +$qtVersion = [version](qmake -query QT_VERSION) +Write-Host "Detected Qt version $qtVersion" # Ship OpenSSL for older Qt versions. Starting 6.8, windeployqt doesn't deploy the OpenSSL backend # by default; although it's easy to opt in, the Schannel backend seems solid enough at this point. @@ -29,21 +25,19 @@ if ($qtVersion -lt [version]'6.8' -and $env:buildArch -ne 'Arm64') { # Copy to output dir if ($env:buildArch -eq 'X86') { - copy "openssl\$($openSslSubfolder)x86\bin\libssl-$openSslFilenameVersion.dll" bin - copy "openssl\$($openSslSubfolder)x86\bin\libcrypto-$openSslFilenameVersion.dll" bin + copy "openssl\${openSslSubfolder}x86\bin\libssl-$openSslFilenameVersion.dll" bin + copy "openssl\${openSslSubfolder}x86\bin\libcrypto-$openSslFilenameVersion.dll" bin } else { - copy "openssl\$($openSslSubfolder)x64\bin\libssl-$openSslFilenameVersion-x64.dll" bin - copy "openssl\$($openSslSubfolder)x64\bin\libcrypto-$openSslFilenameVersion-x64.dll" bin + copy "openssl\${openSslSubfolder}x64\bin\libssl-$openSslFilenameVersion-x64.dll" bin + copy "openssl\${openSslSubfolder}x64\bin\libcrypto-$openSslFilenameVersion-x64.dll" bin } } -if ($env:buildArch -eq 'Arm64') { - # Run windeployqt in cross-compilation mode - & "$env:QT_HOST_PATH\bin\windeployqt" "--qmake=$env:QT_ROOT_DIR\bin\qmake.bat" --no-compiler-runtime bin\qView.exe -} else { - # Run windeployqt which should be in path - windeployqt --no-compiler-runtime bin\qView.exe -} +# Run windeployqt +$isCrossCompile = $env:buildArch -eq 'Arm64' +$winDeployQt = $isCrossCompile ? "$env:QT_HOST_PATH\bin\windeployqt" : "windeployqt" +$argQtPaths = $isCrossCompile ? "--qtpaths=$env:QT_ROOT_DIR\bin\qtpaths.bat" : $null +& $winDeployQt $argQtPaths --no-compiler-runtime "bin\qView.exe" if ($qtVersion -ge [version]'6.8.1') { # Copy font so windows11 style can work on Windows 10