1+ name : Build WinPython Dot 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_1dotb3.txt" >> $GITHUB_ENV
19+ echo "WINPYrequirementswhl=winpython\portable\cycle_2025_04\requir.64-3_13_5_1dotb3_wheels.txt" >> $GITHUB_ENV
20+ echo "WINPYZIP=0">> $GITHUB_ENV
21+ echo "WINPY7Z=1">> $GITHUB_ENV
22+ echo "WINPYEXE=0">> $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.0whlcb3" >> $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.12.11+20250723-aarch64-pc-windows-msvc-install_only_stripped.tar.gz" >> $GITHUB_ENV
34+ echo "build_location=WPy64-31350b3" >> $GITHUB_ENV
35+ echo "WINPYVER=3.13.5.1whlcb3" >> $GITHUB_ENV
36+ echo "WINPYVER2=3.13.5.1" >> $GITHUB_ENV
37+ echo "WINPYFLAVOR=whlc" >> $GITHUB_ENV
38+
39+
40+ - name : see variables
41+ shell : pwsh
42+ run : |
43+ Write-Output "WINPYVERSION is $env:WINPYVERSION"
44+ Write-Output "python_source is $env:python_source"
45+ Write-Output "python_sha256 is $env:python_sha256"
46+
47+ - name : Download python-3 standalone
48+ shell : pwsh
49+ run : |
50+ curl.exe -L -o "python-3-embed.tar.gz" $env:python_source
51+ # Calculate SHA256 hash
52+ $filePath = "python-3-embed.tar.gz"
53+ $expectedHash = $env:python_sha256
54+
55+ $hashObject = Get-FileHash -Path $filePath -Algorithm SHA256
56+ $actualHash = $hashObject.Hash.ToLower()
57+
58+ if ($actualHash -eq $expectedHash.ToLower()) {
59+ Write-Output "Hash matches."
60+ } else {
61+ Write-Output "Hash does NOT match."
62+ Write-Output "Actual: $actualHash"
63+ Write-Output "Expected: $expectedHash"
64+ exit 1
65+ }
66+
67+ - name : Extract python-3-embed.tar.gz to dotpython
68+ shell : bash
69+ env :
70+ WINPYVERSION : ${{ env.WINPYVERSION }}
71+ run : |
72+ mkdir dotpython
73+ tar -xf python-3-embed.tar.gz -C dotpython
74+
75+ # - name: re-compress archive in zip for usual worflow
76+ # shell: pwsh
77+ # run: |
78+ # Compress-Archive -Path build_output\* -DestinationPath python-3.13.6.amd64.zip
79+
80+ - name : Copy launchers_final files to dotpython
81+ # enriching things: dotpython can be used as the building python
82+ shell : bash
83+ run : |
84+ # would run with shell: bash
85+ cp -r winpython/portable/launchers_final/* dotpython/
86+ # would run with shell: pwsh
87+ #if (-not (Test-Path "dotpython")) { New-Item -ItemType Directory -Path "dotpython" | Out-Null }
88+ #Copy-Item -Path "winpython/portable/launchers_final/*" -Destination "dotpython/" -Recurse -Force
89+
90+ - name : List dotpython contents (for debugging)
91+ shell : pwsh
92+ run : |
93+ Get-ChildItem dotpython
94+
95+ - name : Prepare WinPython target dot structure
96+ shell : pwsh
97+ run : |
98+ New-Item -ItemType Directory -Path $env:build_location
99+ Get-ChildItem -Path dotpython -Force | Move-Item -Destination $env:build_location -Force
100+ # Add more WinPython-specific folders/files here if needed
101+
102+ - name : upgrade pip to get structure and icons launchers
103+ shell : pwsh
104+ run : |
105+ & "$env:build_location\python\python.exe" -m pip install --upgrade pip
106+
107+
108+ - name : Write env.ini file
109+ shell : pwsh
110+ run : |
111+ $destDir = "$env:build_location\python\scripts"
112+ echo "WINPYthon_exe=$env:WINPYthon_exe" > env.ini
113+ echo "WINPYthon_subdirectory_name=$env:WINPYthon_subdirectory_name" >> env.ini
114+ echo "WINPYVER=$env:WINPYVER" >> env.ini
115+ echo "WINPYVER2=$env:WINPYVER2" >> env.ini
116+ echo "WINPYFLAVOR=$env:WINPYFLAVOR" >> env.ini
117+ echo "WINPYARCH=$env:WINPYARCH" >> env.ini
118+ Copy-Item -Path "env.ini" -Destination "$destDir\env.ini"
119+
120+ - name : download requirements as hashed-requirements in dotpython\wheelhouse
121+ shell : pwsh
122+ run : |
123+ & "$env:build_location\python\python.exe" -m pip download --dest dotpython\wheelhouse --no-deps --require-hashes -r $env:WINPYrequirements
124+
125+ $destwheelhouse="$env:build_location\wheelhouse"
126+ if ($env:WINPYrequirementswhl -eq "") {
127+ Write-Output "no Wheelhouse"
128+ } else {
129+ & "$env:build_location\python\python.exe" -m pip download --dest dotpython\wheelhouse --no-deps --require-hashes -r $env:WINPYrequirementswhl
130+ }
131+ - name : install requirements as hashed-requirements from dotpython\wheelhouse
132+ shell : pwsh
133+ run : |
134+ & "$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
135+
136+
137+ - name : List build_location Markdowned content (for debugging)
138+ shell : pwsh
139+ run : |
140+ mkdir publish_dot
141+ $destfile = "publish_dot\WinPython$env:WINPYFLAVOR-$env:WINPYARCHbit-$env:WINPYVER2.md"
142+ & "$env:build_location\python\python.exe" -m wppm -md
143+ & "$env:build_location\python\python.exe" -m wppm -md | Out-File -FilePath $destfile -Encoding utf8
144+
145+ & "$env:build_location\python\python.exe" -m pip freeze | Out-File -FilePath dotpython\freeze.txt
146+ $destfile = "publish_dot\pylock.$env:WINPYARCH-$($env:WINPYVER -replace '\.', '_').toml"
147+ & "$env:build_location\python\python.exe" -m pip lock --no-deps --find-links=dotpython\wheelhouse -r dotpython\freeze.txt -o $destfile
148+
149+ $outreq = "publish_dot\requir.$env:WINPYARCH-$($env:WINPYVER -replace '\.', '_').txt"
150+ & "$env:build_location\python\python.exe" -X utf8 -c "from wppm import wheelhouse as wh; wh.pylock_to_req(r'$destfile', r'$outreq')"
151+
152+ - name : Zip the result
153+ shell : pwsh
154+ run : |
155+ $destfile = "publish_dot\WinPython-$env:WINPYARCHbit-$env:WINPYVER.zip"
156+ if ($env:WINPYZIP -eq "1") {
157+ Compress-Archive -Path "$env:build_location" -DestinationPath $destfile
158+ }
159+ - name : 7z archive the result
160+ shell : pwsh
161+ run : |
162+ $destfile7z = "publish_dot\WinPython-$env:WINPYARCHbit-$env:WINPYVER.7z"
163+ $sourceDir = "$env:build_location"
164+
165+ # Use 7z.exe from PATH, or specify full path if needed
166+ if ($env:WINPY7Z -eq "1") {
167+ 7z a $destfile7z $sourceDir
168+ }
169+
170+ - name : 7z executable archive the result
171+ shell : pwsh
172+ run : |
173+ $destfile7z = "publish_dot\WinPython-$env:WINPYARCHbit-$env:WINPYVER.exe"
174+ $sourceDir = "$env:build_location"
175+
176+ # Use 7z.exe from PATH, or specify full path if needed
177+ if ($env:WINPYEXE -eq "1") {
178+ 7z a -sfx $destfile7z $sourceDir
179+ }
180+
181+ - name : Upload WinPython folder as artifact
182+ uses : actions/upload-artifact@v4
183+ with :
184+ name : publish_whlc
185+ path : publish_dot
186+ # retention-days: 30 # keeps artifact for 30 days
0 commit comments