Skip to content

Commit ec96d9f

Browse files
committed
Fixed python version
1 parent 786f787 commit ec96d9f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/windows.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,17 @@ jobs:
104104
$stage = 'C:\_stage\ssh-studio'
105105
New-Item -ItemType Directory -Force -Path $stage | Out-Null
106106
107-
# Download latest Python 3.12 embeddable (resolve dynamically)
107+
# Download specific Python 3.13.7 embeddable ZIP (validated)
108108
$pyZip = "$env:RUNNER_TEMP\python-embed.zip"
109-
$idx = Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/' -UseBasicParsing
110-
$vers = ($idx.Links | Where-Object { $_.href -match '^3\.12\.(\d+)/$' } | ForEach-Object { $_.href.TrimEnd('/') }) | Sort-Object {[version]$_} -Descending
111-
if (-not $vers -or -not $vers[0]) { throw 'Could not determine latest Python 3.12 version from python.org index.' }
112-
$pyVer = $vers[0]
113-
$pyUrl = "https://www.python.org/ftp/python/$pyVer/python-$pyVer-embed-amd64.zip"
109+
$pyUrl = 'https://www.python.org/ftp/python/3.13.7/python-3.13.7-embed-amd64.zip'
114110
Invoke-WebRequest -Uri $pyUrl -OutFile $pyZip
115111
Expand-Archive -LiteralPath $pyZip -DestinationPath "$stage\python" -Force
116-
$pth = Join-Path "$stage\python" 'python312._pth'
117-
if (Test-Path $pth) {
112+
# Enable site packages in the embeddable runtime (.pth filename varies)
113+
$pthFile = Get-ChildItem -Path "$stage\python" -Filter '*._pth' | Select-Object -First 1
114+
if ($pthFile) {
115+
$pth = $pthFile.FullName
118116
$content = Get-Content -Raw -Path $pth
119-
if ($content -notmatch 'import site') {
120-
Add-Content -Path $pth -Value "`r`nimport site`r`n"
121-
}
117+
if ($content -notmatch 'import site') { Add-Content -Path $pth -Value "`r`nimport site`r`n" }
122118
}
123119
124120
# Download GTK runtime (gvsbuild release)

0 commit comments

Comments
 (0)