ci: install Python for Qt setup on Windows
Some checks failed
Build Windows Release / Build Windows x64 Release (MSVC + Qt) (push) Failing after 50s
Some checks failed
Build Windows Release / Build Windows x64 Release (MSVC + Qt) (push) Failing after 50s
This commit is contained in:
@@ -67,9 +67,23 @@ jobs:
|
||||
$pythonArgs = @('-3')
|
||||
} else {
|
||||
$python = Get-Command python -ErrorAction SilentlyContinue
|
||||
if (-not $python) { throw 'Python is required to install Qt with aqtinstall, but py/python was not found on PATH.' }
|
||||
$pythonExe = $python.Source
|
||||
$pythonArgs = @()
|
||||
if ($python) {
|
||||
$pythonExe = $python.Source
|
||||
$pythonArgs = @()
|
||||
} else {
|
||||
$pythonRoot = Join-Path $env:RUNNER_TEMP 'python312'
|
||||
$pythonExe = Join-Path $pythonRoot 'python.exe'
|
||||
if (-not (Test-Path $pythonExe)) {
|
||||
$installer = Join-Path $env:RUNNER_TEMP 'python-installer.exe'
|
||||
$pythonUrl = 'https://www.python.org/ftp/python/3.12.10/python-3.12.10-amd64.exe'
|
||||
Write-Host "Downloading Python from $pythonUrl"
|
||||
Invoke-WebRequest -Uri $pythonUrl -OutFile $installer
|
||||
& $installer /quiet InstallAllUsers=0 TargetDir=$pythonRoot Include_pip=1 Include_test=0 PrependPath=0
|
||||
if ($LASTEXITCODE -ne 0) { throw "Python installer failed, exit code: $LASTEXITCODE" }
|
||||
}
|
||||
if (-not (Test-Path $pythonExe)) { throw "Python installation finished but python.exe was not found: $pythonExe" }
|
||||
$pythonArgs = @()
|
||||
}
|
||||
}
|
||||
|
||||
& $pythonExe @pythonArgs -m pip install --user --upgrade aqtinstall
|
||||
|
||||
Reference in New Issue
Block a user