rssguard/resources/scripts/github-actions/build-windows.ps1

50 lines
1.5 KiB
PowerShell
Raw Normal View History

2020-12-08 11:04:40 +01:00
$os = $args[0]
2020-12-08 11:34:07 +01:00
$webengine = $args[1]
2020-12-08 11:02:20 +01:00
2020-12-08 11:24:26 +01:00
echo "We are building for MS Windows."
2020-12-08 12:44:28 +01:00
echo "OS: $os; WebEngine: $webengine"
$old_pwd = $pwd.Path
2020-12-08 13:14:12 +01:00
# Prepare environment.
2020-12-08 13:30:49 +01:00
Install-Module Pscx -Scope CurrentUser -AllowClobber -Force
Install-Module VSSetup -Scope CurrentUser -AllowClobber -Force
2020-12-08 13:46:16 +01:00
Import-VisualStudioVars -Architecture x64
2020-12-08 13:14:12 +01:00
2020-12-08 12:44:28 +01:00
# Get Qt.
$qt_version = "5.15.1"
$qt_stub = "qt-$qt_version-dynamic-msvc2019-x86_64"
$qt_link = "https://github.com/martinrotter/qt5-minimalistic-builds/releases/download/$qt_version/$qt_stub.7z"
$qt_output = "qt.7z"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $qt_link -OutFile $qt_output
& ".\resources\scripts\7za\7za.exe" x $qt_output
$qt_path = (Resolve-Path $qt_stub).Path
$qt_qmake = "$qt_path\bin\qmake.exe"
2020-12-08 12:52:00 +01:00
$env:PATH = "$qt_path\bin\;" + $env:PATH
2020-12-08 12:59:10 +01:00
# Build application.
2020-12-08 12:52:00 +01:00
mkdir "rssguard-build"
cd "rssguard-build"
& "$qt_qmake" "..\build.pro" "-r" "USE_WEBENGINE=$webengine" "CONFIG-=debug" "CONFIG-=debug_and_release" "CONFIG*=release"
nmake.exe
cd "src\rssguard"
nmake.exe install
cd "app"
windeployqt.exe --verbose 1 --compiler-runtime --no-translations --release rssguard.exe librssguard.dll
cd ".."
# Copy OpenSSL.
Copy-Item -Path "$qt_path\bin\libcrypto*.dll" -Destination ".\app\"
Copy-Item -Path "$qt_path\bin\libssl*.dll" -Destination ".\app\"
# Copy MySQL Qt plugin.
Copy-Item -Path "$qt_path\bin\libmariadb.dll" -Destination ".\app\"
nmake.exe windows_all
ls