Skip to content

Commit 999d306

Browse files
author
Bryan Howard
committed
trying the install subfolder
1 parent 1429511 commit 999d306

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

.github/workflows/windows-build.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# .github/workflows/windows-build.yml
22
# GitHub Actions workflow to build a standalone Windows executable and create a release.
3-
# This version correctly downloads the 'install_only' Python package and bootstraps pip into it.
3+
# This version correctly downloads the full standalone Python package and extracts the
4+
# runnable distribution from the correct 'install' subfolder.
45

56
name: Build and Release Windows App
67

@@ -30,47 +31,35 @@ jobs:
3031
- name: Prepare Portable Python Runtime
3132
shell: pwsh
3233
run: |
33-
# 1. Download the correct 'install_only' standalone Python distribution in .tar.gz format.
34+
# 1. Download the full, pre-built, standalone Python distribution.
3435
$pythonVersion = "3.11.13"
3536
$releaseTag = "20250808"
36-
$fileName = "cpython-$($pythonVersion)+$($releaseTag)-x86_64-pc-windows-msvc-install_only.tar.gz"
37+
$fileName = "cpython-$($pythonVersion)+$($releaseTag)-x86_64-pc-windows-msvc-pgo-full.tar.zst"
3738
$url = "https://github.com/astral-sh/python-build-standalone/releases/download/$releaseTag/$fileName"
3839
3940
Write-Host "Downloading Python runtime from $url"
40-
Invoke-WebRequest -Uri $url -OutFile "python-standalone.tar.gz"
41+
Invoke-WebRequest -Uri $url -OutFile "python-standalone.tar.zst"
4142
42-
# 2. Decompress the archive. tar on Windows runners handles .gz natively.
43+
# 2. Decompress the archive.
4344
Write-Host "Decompressing Python runtime..."
44-
tar -xzf python-standalone.tar.gz
45+
tar -I zstd -xf python-standalone.tar.zst
4546
46-
# 3. Move the contents to the 'python_runtime' directory
47-
Move-Item -Path "python\*" -Destination "python_runtime"
47+
# 3. BUG FIX: Move the contents from the correct 'python\install' subfolder.
48+
Write-Host "Moving extracted runtime to 'python_runtime'..."
49+
Move-Item -Path "python\install\*" -Destination "python_runtime"
4850
Remove-Item "python" -Recurse
4951
50-
# --- Verification Step 1 ---
51-
Write-Host "Verifying python.exe exists..."
52+
# --- Verification Step ---
53+
Write-Host "Verifying contents of python_runtime directory:"
54+
Get-ChildItem -Path "python_runtime"
5255
if (-not (Test-Path "python_runtime\python.exe")) {
5356
Write-Host "CRITICAL ERROR: python.exe not found after extraction. Build cannot continue."
5457
exit 1
5558
}
56-
57-
# 4. Download the official pip bootstrap script.
58-
Write-Host "Downloading get-pip.py..."
59-
Invoke-WebRequest -Uri "https://bootstrap.pypa.io/get-pip.py" -OutFile "python_runtime\get-pip.py"
60-
61-
# 5. Run the bootstrap script to install pip into the portable runtime.
62-
Write-Host "Installing pip into the portable runtime..."
63-
.\python_runtime\python.exe .\python_runtime\get-pip.py
64-
65-
# --- Verification Step 2 ---
66-
Write-Host "Verifying pip.exe exists..."
6759
if (-not (Test-Path "python_runtime\Scripts\pip.exe")) {
68-
Write-Host "CRITICAL ERROR: pip.exe not found after installation. Build cannot continue."
60+
Write-Host "CRITICAL ERROR: pip.exe not found after extraction. Build cannot continue."
6961
exit 1
7062
}
71-
72-
# 6. Clean up the bootstrap script.
73-
Remove-Item "python_runtime\get-pip.py"
7463
Write-Host "Python runtime prepared successfully."
7564
7665
- name: Cache Pip and Nuitka

0 commit comments

Comments
 (0)