1+ name : Build WinPython whl 3.13.6, # 2025-08-14: python-3.13.6, before 3.13.7 (the 15th...)
2+ # later we can use matrix https://github.com/orgs/community/discussions/7835#discussioncomment-1769026
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ build-dot :
8+ runs-on : windows-latest
9+ steps :
10+ - name : Checkout repository
11+ uses : actions/checkout@v4
12+
13+ - name : set variables
14+ shell : bash
15+ run : |
16+ echo "WINPYARCH=64" >> $GITHUB_ENV
17+ echo "WINPYVERSION=313" >> $GITHUB_ENV
18+ echo "WINPYrequirements=winpython\portable\cycle_2025_04\requir.64-3_13_5_1slimb3.txt" >> $GITHUB_ENV
19+ echo "WINPYrequirementswhl=" >> $GITHUB_ENV
20+ echo "WINPYZIP=0">> $GITHUB_ENV
21+ echo "WINPY7Z=1">> $GITHUB_ENV
22+ echo "WINPYEXE=1">> $GITHUB_ENV
23+
24+ #3.13.6
25+ #echo "python_source=https://github.com/astral-sh/python-build-standalone/releases/download/20250814/cpython-3.13.6+20250814-x86_64-pc-windows-msvc-install_only_stripped.tar.gz" >> $GITHUB_ENV
26+ #echo "python_sha256=09e489d2e7123cbd8111293e91af08efd203c9229c9e761ba3995bb263a6fa92" >> $GITHUB_ENV
27+ #echo "build_location=WPy64-31360b3" >> $GITHUB_ENV
28+ #echo "WINPYVER=3.13.6.0slimcb3" >> $GITHUB_ENV
29+ #echo "WINPYVER2=3.13.6.0" >> $GITHUB_ENV
30+
31+ #3.13.5
32+ echo "build_location=WPy64-31351b3" >> $GITHUB_ENV
33+ echo "python_source=https://github.com/astral-sh/python-build-standalone/releases/download/20250723/cpython-3.13.5+20250723-x86_64-pc-windows-msvc-install_only_stripped.tar.gz" >> $GITHUB_ENV
34+ echo "python_sha256=4d88fdda4a59e0d6d45953c37c2fcb4e114dd5a2d41cb5b24b75b42ab8328ff8" >> $GITHUB_ENV
35+ echo "build_location=WPy64-31350b3" >> $GITHUB_ENV
36+ echo "WINPYVER=3.13.5.1slimcb3" >> $GITHUB_ENV
37+ echo "WINPYVER2=3.13.5.1" >> $GITHUB_ENV
38+
39+ echo "WINPYFLAVOR=slimc" >> $GITHUB_ENV
40+
41+
42+ - name : see variables
43+ shell : pwsh
44+ run : |
45+ Write-Output "WINPYVERSION is $env:WINPYVERSION"
46+ Write-Output "WINPYFLAVOR is $env:WINPYFLAVOR"
47+ Write-Output "python_source is $env:python_source"
48+ Write-Output "python_sha256 is $env:python_sha256"
49+ Write-Output "WINPYrequirements is $env:WINPYrequirements"
50+ Write-Output "WINPYrequirementswhl is $env:WINPYrequirementswhl"
51+
52+ - name : Download python-3 standalone
53+ shell : pwsh
54+ run : |
55+ curl.exe -L -o "python-3-embed.tar.gz" $env:python_source
56+ # Calculate SHA256 hash
57+ $filePath = "python-3-embed.tar.gz"
58+ $expectedHash = $env:python_sha256
59+
60+ $hashObject = Get-FileHash -Path $filePath -Algorithm SHA256
61+ $actualHash = $hashObject.Hash.ToLower()
62+
63+ if ($actualHash -eq $expectedHash.ToLower()) {
64+ Write-Output "Hash matches."
65+ } else {
66+ Write-Output "Hash does NOT match."
67+ Write-Output "Actual: $actualHash"
68+ Write-Output "Expected: $expectedHash"
69+ exit 1
70+ }
71+
72+ - name : Extract python-3-embed.tar.gz to dotpython
73+ shell : bash
74+ env :
75+ WINPYVERSION : ${{ env.WINPYVERSION }}
76+ run : |
77+ mkdir dotpython
78+ tar -xf python-3-embed.tar.gz -C dotpython
79+
80+ # - name: re-compress archive in zip for usual worflow
81+ # shell: pwsh
82+ # run: |
83+ # Compress-Archive -Path build_output\* -DestinationPath python-3.13.6.amd64.zip
84+
85+ - name : Copy launchers_final files to dotpython
86+ # enriching things: dotpython can be used as the building python
87+ shell : bash
88+ run : |
89+ # would run with shell: bash
90+ cp -r winpython/portable/launchers_final/* dotpython/
91+ # would run with shell: pwsh
92+ #if (-not (Test-Path "dotpython")) { New-Item -ItemType Directory -Path "dotpython" | Out-Null }
93+ #Copy-Item -Path "winpython/portable/launchers_final/*" -Destination "dotpython/" -Recurse -Force
94+
95+ mkdir "dotpython\wheelhouse"
96+
97+ - name : List dotpython contents (for debugging)
98+ shell : pwsh
99+ run : |
100+ Get-ChildItem dotpython
101+
102+ - name : Prepare WinPython target dot structure
103+ shell : pwsh
104+ run : |
105+ New-Item -ItemType Directory -Path $env:build_location
106+ Get-ChildItem -Path dotpython -Force | Move-Item -Destination $env:build_location -Force
107+ # Add more WinPython-specific folders/files here if needed
108+
109+ - name : upgrade pip to get structure and icons launchers
110+ shell : pwsh
111+ run : |
112+ & "$env:build_location\python\python.exe" -m pip install --upgrade pip
113+
114+
115+ - name : Write env.ini file
116+ shell : pwsh
117+ run : |
118+ $destDir = "$env:build_location\python\scripts"
119+ echo "WINPYthon_exe=$env:WINPYthon_exe" > env.ini
120+ echo "WINPYthon_subdirectory_name=$env:WINPYthon_subdirectory_name" >> env.ini
121+ echo "WINPYVER=$env:WINPYVER" >> env.ini
122+ echo "WINPYVER2=$env:WINPYVER2" >> env.ini
123+ echo "WINPYFLAVOR=$env:WINPYFLAVOR" >> env.ini
124+ echo "WINPYARCH=$env:WINPYARCH" >> env.ini
125+ Copy-Item -Path "env.ini" -Destination "$destDir\env.ini"
126+
127+ - name : download requirements as hashed-requirements in dotpython\wheelhouse
128+ shell : pwsh
129+ run : |
130+ & "$env:build_location\python\python.exe" -m pip download --dest dotpython\wheelhouse --no-deps --require-hashes -r $env:WINPYrequirements
131+
132+ - name : download wheelhouserequirements as hashed-requirements in $env:build_location\wheelhouse
133+ shell : pwsh
134+ run : |
135+ $destwheelhouse="$env:build_location\wheelhouse"
136+ if ($env:WINPYrequirementswhl -eq "") {
137+ Write-Output "no Wheelhouse"
138+ } else {
139+ & "$env:build_location\python\python.exe" -m pip download --dest $destwheelhouse --no-deps --require-hashes -r $env:WINPYrequirementswhl
140+ }
141+
142+ - name : install requirements as hashed-requirements from dotpython\wheelhouse
143+ shell : pwsh
144+ run : |
145+ & "$env:build_location\python\python.exe" -m pip install --no-deps --no-index --trusted-host=None --find-links=dotpython\wheelhouse --require-hashes -r $env:WINPYrequirements
146+
147+
148+ - name : List build_location Markdowned content (for debugging)
149+ shell : pwsh
150+ run : |
151+ mkdir publish_dot
152+ $destfile = "publish_dot\WinPython$env:WINPYFLAVOR-$env:WINPYARCHbit-$env:WINPYVER2.md"
153+ & "$env:build_location\python\python.exe" -m wppm -md
154+ & "$env:build_location\python\python.exe" -m wppm -md | Out-File -FilePath $destfile -Encoding utf8
155+
156+ & "$env:build_location\python\python.exe" -m pip freeze | Out-File -FilePath dotpython\freeze.txt
157+ $destfile = "publish_dot\pylock.$env:WINPYARCH-$($env:WINPYVER -replace '\.', '_').toml"
158+ & "$env:build_location\python\python.exe" -m pip lock --no-deps --find-links=dotpython\wheelhouse -r dotpython\freeze.txt -o $destfile
159+
160+ $outreq = "publish_dot\requir.$env:WINPYARCH-$($env:WINPYVER -replace '\.', '_').txt"
161+ & "$env:build_location\python\python.exe" -X utf8 -c "from wppm import wheelhouse as wh; wh.pylock_to_req(r'$destfile', r'$outreq')"
162+
163+ - name : Zip the result
164+ shell : pwsh
165+ run : |
166+ $destfile = "publish_dot\WinPython$env:WINPYARCH-$env:WINPYVER.zip"
167+ if ($env:WINPYZIP -eq "1") {
168+ Compress-Archive -Path "$env:build_location" -DestinationPath $destfile
169+ }
170+ - name : 7z archive the result
171+ shell : pwsh
172+ run : |
173+ $destfile7z = "publish_dot\WinPython$env:WINPYARCH-$env:WINPYVER.7z"
174+ $sourceDir = "$env:build_location"
175+
176+ # Use 7z.exe from PATH, or specify full path if needed
177+ if ($env:WINPY7Z -eq "1") {
178+ 7z a $destfile7z $sourceDir
179+ }
180+
181+ - name : 7z executable archive the result
182+ shell : pwsh
183+ run : |
184+ $destfile7z = "publish_dot\WinPython$env:WINPYARCH-$env:WINPYVER.exe"
185+ $sourceDir = "$env:build_location"
186+
187+ # Use 7z.exe from PATH, or specify full path if needed
188+ if ($env:WINPYEXE -eq "1") {
189+ 7z a -sfx $destfile7z $sourceDir
190+ }
191+
192+ - name : Upload WinPython folder as artifact
193+ uses : actions/upload-artifact@v4
194+ with :
195+ name : publish_slimc
196+ path : publish_dot
197+ # retention-days: 30 # keeps artifact for 30 days
0 commit comments