Build WinPython slim 3.13.6, #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build WinPython slim 3.13.6, # 2025-08-14: python-3.13.6, before 3.13.7 (the 15th...) | |
# later we can use matrix https://github.com/orgs/community/discussions/7835#discussioncomment-1769026 | |
on: | |
workflow_dispatch: | |
jobs: | |
build-dot: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: set variables | |
shell: bash | |
run: | | |
echo "WINPYARCH=64" >> $GITHUB_ENV | |
echo "WINPYVERSION=313" >> $GITHUB_ENV | |
echo "WINPYrequirements=winpython\portable\cycle_2025_04\requir.64-3_13_5_1slimb3.txt" >> $GITHUB_ENV | |
echo "WINPYrequirementswhl=" >> $GITHUB_ENV | |
echo "WINPYZIP=0">> $GITHUB_ENV | |
echo "WINPY7Z=1">> $GITHUB_ENV | |
echo "WINPYEXE=1">> $GITHUB_ENV | |
#3.13.6 | |
#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 | |
#echo "python_sha256=09e489d2e7123cbd8111293e91af08efd203c9229c9e761ba3995bb263a6fa92" >> $GITHUB_ENV | |
#echo "build_location=WPy64-31360b3" >> $GITHUB_ENV | |
#echo "WINPYVER=3.13.6.0slimcb3" >> $GITHUB_ENV | |
#echo "WINPYVER2=3.13.6.0" >> $GITHUB_ENV | |
#3.13.5 | |
echo "build_location=WPy64-31351b3" >> $GITHUB_ENV | |
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 | |
echo "python_sha256=4d88fdda4a59e0d6d45953c37c2fcb4e114dd5a2d41cb5b24b75b42ab8328ff8" >> $GITHUB_ENV | |
echo "build_location=WPy64-31350b3" >> $GITHUB_ENV | |
echo "WINPYVER=3.13.5.1slimcb3" >> $GITHUB_ENV | |
echo "WINPYVER2=3.13.5.1" >> $GITHUB_ENV | |
echo "WINPYFLAVOR=slimc" >> $GITHUB_ENV | |
- name: see variables | |
shell: pwsh | |
run: | | |
Write-Output "WINPYVERSION is $env:WINPYVERSION" | |
Write-Output "WINPYFLAVOR is $env:WINPYFLAVOR" | |
Write-Output "python_source is $env:python_source" | |
Write-Output "python_sha256 is $env:python_sha256" | |
Write-Output "WINPYrequirements is $env:WINPYrequirements" | |
Write-Output "WINPYrequirementswhl is $env:WINPYrequirementswhl" | |
- name: Download python-3 standalone | |
shell: pwsh | |
run: | | |
curl.exe -L -o "python-3-embed.tar.gz" $env:python_source | |
# Calculate SHA256 hash | |
$filePath = "python-3-embed.tar.gz" | |
$expectedHash = $env:python_sha256 | |
$hashObject = Get-FileHash -Path $filePath -Algorithm SHA256 | |
$actualHash = $hashObject.Hash.ToLower() | |
if ($actualHash -eq $expectedHash.ToLower()) { | |
Write-Output "Hash matches." | |
} else { | |
Write-Output "Hash does NOT match." | |
Write-Output "Actual: $actualHash" | |
Write-Output "Expected: $expectedHash" | |
exit 1 | |
} | |
- name: Extract python-3-embed.tar.gz to dotpython | |
shell: bash | |
env: | |
WINPYVERSION: ${{ env.WINPYVERSION }} | |
run: | | |
mkdir dotpython | |
tar -xf python-3-embed.tar.gz -C dotpython | |
#- name: re-compress archive in zip for usual worflow | |
# shell: pwsh | |
# run: | | |
# Compress-Archive -Path build_output\* -DestinationPath python-3.13.6.amd64.zip | |
- name: Copy launchers_final files to dotpython | |
# enriching things: dotpython can be used as the building python | |
shell: bash | |
run: | | |
# would run with shell: bash | |
cp -r winpython/portable/launchers_final/* dotpython/ | |
# would run with shell: pwsh | |
#if (-not (Test-Path "dotpython")) { New-Item -ItemType Directory -Path "dotpython" | Out-Null } | |
#Copy-Item -Path "winpython/portable/launchers_final/*" -Destination "dotpython/" -Recurse -Force | |
mkdir "dotpython\wheelhouse" | |
- name: List dotpython contents (for debugging) | |
shell: pwsh | |
run: | | |
Get-ChildItem dotpython | |
- name: Prepare WinPython target dot structure | |
shell: pwsh | |
run: | | |
New-Item -ItemType Directory -Path $env:build_location | |
Get-ChildItem -Path dotpython -Force | Move-Item -Destination $env:build_location -Force | |
# Add more WinPython-specific folders/files here if needed | |
- name: upgrade pip to get structure and icons launchers | |
shell: pwsh | |
run: | | |
& "$env:build_location\python\python.exe" -m pip install --upgrade pip | |
- name: Write env.ini file | |
shell: pwsh | |
run: | | |
$destDir = "$env:build_location\python\scripts" | |
echo "WINPYthon_exe=$env:WINPYthon_exe" > env.ini | |
echo "WINPYthon_subdirectory_name=$env:WINPYthon_subdirectory_name" >> env.ini | |
echo "WINPYVER=$env:WINPYVER" >> env.ini | |
echo "WINPYVER2=$env:WINPYVER2" >> env.ini | |
echo "WINPYFLAVOR=$env:WINPYFLAVOR" >> env.ini | |
echo "WINPYARCH=$env:WINPYARCH" >> env.ini | |
Copy-Item -Path "env.ini" -Destination "$destDir\env.ini" | |
- name: download requirements as hashed-requirements in dotpython\wheelhouse | |
shell: pwsh | |
run: | | |
& "$env:build_location\python\python.exe" -m pip download --dest dotpython\wheelhouse --no-deps --require-hashes -r $env:WINPYrequirements | |
- name: download wheelhouserequirements as hashed-requirements in $env:build_location\wheelhouse | |
shell: pwsh | |
run: | | |
$destwheelhouse="$env:build_location\wheelhouse" | |
if ($env:WINPYrequirementswhl -eq "") { | |
Write-Output "no Wheelhouse" | |
} else { | |
& "$env:build_location\python\python.exe" -m pip download --dest $destwheelhouse --no-deps --require-hashes -r $env:WINPYrequirementswhl | |
} | |
- name: install requirements as hashed-requirements from dotpython\wheelhouse | |
shell: pwsh | |
run: | | |
& "$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 | |
- name: List build_location Markdowned content (for debugging) | |
shell: pwsh | |
run: | | |
mkdir publish_dot | |
$destfile = "publish_dot\WinPython$env:WINPYFLAVOR-$env:WINPYARCHbit-$env:WINPYVER2.md" | |
& "$env:build_location\python\python.exe" -m wppm -md | |
& "$env:build_location\python\python.exe" -m wppm -md | Out-File -FilePath $destfile -Encoding utf8 | |
& "$env:build_location\python\python.exe" -m pip freeze | Out-File -FilePath dotpython\freeze.txt | |
$destfile = "publish_dot\pylock.$env:WINPYARCH-$($env:WINPYVER -replace '\.', '_').toml" | |
& "$env:build_location\python\python.exe" -m pip lock --no-deps --find-links=dotpython\wheelhouse -r dotpython\freeze.txt -o $destfile | |
$outreq = "publish_dot\requir.$env:WINPYARCH-$($env:WINPYVER -replace '\.', '_').txt" | |
& "$env:build_location\python\python.exe" -X utf8 -c "from wppm import wheelhouse as wh; wh.pylock_to_req(r'$destfile', r'$outreq')" | |
- name: Zip the result | |
shell: pwsh | |
run: | | |
$destfile = "publish_dot\WinPython$env:WINPYARCH-$env:WINPYVER.zip" | |
if ($env:WINPYZIP -eq "1") { | |
Compress-Archive -Path "$env:build_location" -DestinationPath $destfile | |
} | |
- name: 7z archive the result | |
shell: pwsh | |
run: | | |
$destfile7z = "publish_dot\WinPython$env:WINPYARCH-$env:WINPYVER.7z" | |
$sourceDir = "$env:build_location" | |
# Use 7z.exe from PATH, or specify full path if needed | |
if ($env:WINPY7Z -eq "1") { | |
7z a $destfile7z $sourceDir | |
} | |
- name: 7z executable archive the result | |
shell: pwsh | |
run: | | |
$destfile7z = "publish_dot\WinPython$env:WINPYARCH-$env:WINPYVER.exe" | |
$sourceDir = "$env:build_location" | |
# Use 7z.exe from PATH, or specify full path if needed | |
if ($env:WINPYEXE -eq "1") { | |
7z a -sfx $destfile7z $sourceDir | |
} | |
- name: Upload WinPython folder as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: publish_slimc | |
path: publish_dot | |
#retention-days: 30 # keeps artifact for 30 days |