Skip to content

Commit bb3c752

Browse files
author
Bryan Howard
committed
test
1 parent 999d306 commit bb3c752

File tree

1 file changed

+45
-39
lines changed

1 file changed

+45
-39
lines changed

.github/workflows/windows-build.yml

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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 full standalone Python package and extracts the
4-
# runnable distribution from the correct 'install' subfolder.
3+
# This version correctly downloads and prepares a full, portable Python runtime.
54

65
name: Build and Release Windows App
76

@@ -28,40 +27,6 @@ jobs:
2827
with:
2928
python-version: '3.11'
3029

31-
- name: Prepare Portable Python Runtime
32-
shell: pwsh
33-
run: |
34-
# 1. Download the full, pre-built, standalone Python distribution.
35-
$pythonVersion = "3.11.13"
36-
$releaseTag = "20250808"
37-
$fileName = "cpython-$($pythonVersion)+$($releaseTag)-x86_64-pc-windows-msvc-pgo-full.tar.zst"
38-
$url = "https://github.com/astral-sh/python-build-standalone/releases/download/$releaseTag/$fileName"
39-
40-
Write-Host "Downloading Python runtime from $url"
41-
Invoke-WebRequest -Uri $url -OutFile "python-standalone.tar.zst"
42-
43-
# 2. Decompress the archive.
44-
Write-Host "Decompressing Python runtime..."
45-
tar -I zstd -xf python-standalone.tar.zst
46-
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"
50-
Remove-Item "python" -Recurse
51-
52-
# --- Verification Step ---
53-
Write-Host "Verifying contents of python_runtime directory:"
54-
Get-ChildItem -Path "python_runtime"
55-
if (-not (Test-Path "python_runtime\python.exe")) {
56-
Write-Host "CRITICAL ERROR: python.exe not found after extraction. Build cannot continue."
57-
exit 1
58-
}
59-
if (-not (Test-Path "python_runtime\Scripts\pip.exe")) {
60-
Write-Host "CRITICAL ERROR: pip.exe not found after extraction. Build cannot continue."
61-
exit 1
62-
}
63-
Write-Host "Python runtime prepared successfully."
64-
6530
- name: Cache Pip and Nuitka
6631
uses: actions/cache@v4
6732
with:
@@ -72,9 +37,50 @@ jobs:
7237
restore-keys: |
7338
${{ runner.os }}-pip-
7439
75-
- name: Install Nuitka and PySide6
40+
- name: Install dependencies
7641
run: pip install -r requirements.txt
7742

43+
- name: Download zstd.exe decompressor
44+
shell: pwsh
45+
run: |
46+
Invoke-WebRequest -Uri "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-v1.5.5-win64.zip" -OutFile "zstd.zip"
47+
Expand-Archive -Path "zstd.zip" -DestinationPath "zstd"
48+
$env:PATH += ";${PWD}/zstd"
49+
50+
- name: Download Python standalone runtime
51+
shell: pwsh
52+
run: |
53+
$pythonVersion = "3.11.13"
54+
$releaseTag = "20250808"
55+
$fileName = "cpython-$($pythonVersion)+$($releaseTag)-x86_64-pc-windows-msvc-pgo-full.tar.zst"
56+
$url = "https://github.com/astral-sh/python-build-standalone/releases/download/$releaseTag/$fileName"
57+
58+
Invoke-WebRequest -Uri $url -OutFile "python-standalone.tar.zst"
59+
60+
- name: Decompress Python runtime
61+
shell: pwsh
62+
run: |
63+
.\zstd\zstd.exe -d python-standalone.tar.zst -o python-standalone.tar
64+
tar -xf python-standalone.tar
65+
66+
- name: Move to python_runtime folder
67+
shell: pwsh
68+
run: |
69+
New-Item -ItemType Directory -Force -Path python_runtime
70+
Move-Item -Path "python\install\*" -Destination "python_runtime"
71+
Remove-Item "python" -Recurse -Force
72+
73+
- name: Verify python_runtime
74+
shell: pwsh
75+
run: |
76+
if (-not (Test-Path "python_runtime\python.exe")) { exit 1 }
77+
if (-not (Test-Path "python_runtime\Scripts\pip.exe")) { exit 1 }
78+
79+
- name: Upgrade pip in portable runtime
80+
shell: pwsh
81+
run: |
82+
.\python_runtime\python.exe -m pip install --upgrade pip
83+
7884
- name: Build app with Nuitka
7985
run: |
8086
python -m nuitka `
@@ -99,8 +105,8 @@ jobs:
99105
$build_dir = "NodeEditor_Build"
100106
$dist_dir = Join-Path $build_dir "main.dist"
101107
102-
$new_dir_name = "NodeEditor $version"
103-
$zip_file_name = "NodeEditor_Windows_$version.zip"
108+
$new_dir_name = "PyFlowCanvas $version"
109+
$zip_file_name = "PyFlowCanvas_Windows_$version.zip"
104110
105111
Rename-Item -Path $dist_dir -NewName $new_dir_name
106112

0 commit comments

Comments
 (0)