File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,13 @@ jobs:
104104 $stage = 'C:\_stage\ssh-studio'
105105 New-Item -ItemType Directory -Force -Path $stage | Out-Null
106106
107- # Download Python embeddable 3.12
108- $pyUrl = 'https://www.python.org/ftp/python/3.12.11/python-3.12.11-embed-amd64.zip'
107+ # Download latest Python 3.12 embeddable (resolve dynamically)
109108 $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"
110114 Invoke-WebRequest -Uri $pyUrl -OutFile $pyZip
111115 Expand-Archive -LiteralPath $pyZip -DestinationPath "$stage\python" -Force
112116 $pth = Join-Path "$stage\python" 'python312._pth'
You can’t perform that action at this time.
0 commit comments