From 12ad11c053e9652c499b012242665f6c26496684 Mon Sep 17 00:00:00 2001 From: stonebig Date: Fri, 15 Aug 2025 11:09:05 +0200 Subject: [PATCH] peach build #17: try parametrising a bit --- .../workflows/github_workflows_build-dot.yml | 121 ++++++++++-------- 1 file changed, 70 insertions(+), 51 deletions(-) diff --git a/.github/workflows/github_workflows_build-dot.yml b/.github/workflows/github_workflows_build-dot.yml index 8e3dcc4b..8cda07d8 100644 --- a/.github/workflows/github_workflows_build-dot.yml +++ b/.github/workflows/github_workflows_build-dot.yml @@ -1,5 +1,5 @@ -name: Build WinPython Dot 3.13, # fix to build #5, Copilote AI pwsh was not a so good idea - +name: Build WinPython Dot 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: @@ -10,84 +10,103 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download python-3.13 standalone - #shell: cmd - run: | - #curl -L -o python-3.13-embed.zip https://github.com/indygreg/python-build-standalone/releases/download/20240421/cpython-3.13.0b1+20240421-x86_64-pc-windows-msvc-shared-install_only.zip - curl -L -o python-3.13-embed.zip https://github.com/astral-sh/python-build-standalone/releases/download/20250807/cpython-3.13.6+20250807-x86_64-pc-windows-msvc-install_only_stripped.tar.gz - - name: Show downloaded file info - shell: pwsh + - name: set variables + shell: run: | - Get-Item python-3.13-embed.zip | Format-List Name,Length,LastWriteTime + echo "build_location=WPy64-31360b3" >> $GITHUB_ENV + 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" + echo "python_sha256=09e489d2e7123cbd8111293e91af08efd203c9229c9e761ba3995bb263a6fa92" - - name: Wait before extraction - shell: pwsh - run: | - Start-Sleep -Seconds 2 + echo "WINPYINSTALLER=7zip.zip" >> $GITHUB_ENV + echo "WINPYVERSION=313" >> $GITHUB_ENV - - name: Extract python-3.13-embed.zip - #shell: pwsh + echo "WINPYthon_exe=python.exe" >> $GITHUB_ENV + echo "WINPYthon_subdirectory_name=python" >> $GITHUB_ENV + echo "WINPYVER=3.13.6.0dotb3" >> $GITHUB_ENV + echo "WINPYVER2=3.13.6.0" >> $GITHUB_ENV + echo "WINPYFLAVOR=dot" >> $GITHUB_ENV + echo "WINPYARCH=64" >> $GITHUB_ENV + + echo "WINPYrequirements=winpython\portable\cycle_2025_04\requir.64-3_13_5_1dotb3.txt" >> $GITHUB_ENV + + - name: Download python-3 standalone + run: | + curl -L -o python-$WINPYVERSION-embed.tar.gz $python_source + # Calculate SHA256 hash + actual_hash=$(sha256sum python-$WINPYVERSION-embed.tar.gz | cut -d' ' -f1) + + if [ "$actual_hash" = "$python_sha256" ]; then + echo "Hash matches." + else + echo "Hash does NOT match." + echo "$actual_hash" + echo "$python_sha256" + exit 1 + fi + + - name: Extract python-$WINPYVERSION-embed.tar.gz to dotpython run: | - #New-Item -ItemType Directory -Path dotpython - #Expand-Archive -Path python-3.13-embed.zip -DestinationPath dotpython mkdir dotpython - tar -xf python-3.13-embed.zip -C dotpython + tar -xf python-$WINPYVERSION-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: will need one python to play on the other, so why not there too - #shell: bash - shell: pwsh + # enriching things: dotpython can be used as the building python + #shell: pwsh run: | # would run with shell: bash - # cp -r winpython/portable/launchers_final/* dotpython/ - if (-not (Test-Path "dotpython")) { New-Item -ItemType Directory -Path "dotpython" | Out-Null } - Copy-Item -Path "winpython/portable/launchers_final/*" -Destination "dotpython/" -Recurse -Force + 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 + - 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: List dotpython contents (for debugging) shell: pwsh run: | - #Get-ChildItem -Recurse dotpython Get-ChildItem dotpython - name: Prepare WinPython target dot structure shell: pwsh run: | - New-Item -ItemType Directory -Path WPy64-31351b3 - # Get-ChildItem dotpython | Move-Item -Destination WinPython-dot-3.13 - # fix: Usually, indygreg zips extract all files directly into the target, not into a subfolder: dotpython/python.exe, dotpython/Lib, etc. - Get-ChildItem -Path dotpython -Force | Move-Item -Destination WPy64-31351b3 -Force + 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: try upgrade pip + - name: upgrade pip to get icons launchers shell: pwsh run: | - WPy64-31351b3\python\python.exe -m pip install --upgrade pip + & "$env:build_location\python\python.exe" -m pip install --upgrade pip - - name: try download requirements as hashed-requirements - shell: pwsh - run: | - WPy64-31351b3\python\python.exe -m pip download --dest dotpython\wheelhouse --no-deps --require-hashes -r "winpython\portable\cycle_2025_04\requir.64-3_13_5_1dotb3.txt" - #WPy64-31351b3\python\python.exe -m pip install --no-deps --no-index --trusted-host=None --find-links=dotpython\wheelhouse --require-hashes -r "winpython\portable\cycle_2025_04\requir.64-3_13_5_1dotb3.txt" - - - name: try install requirements as hashed-requirements - shell: pwsh - run: | - WPy64-31351b3\python\python.exe -m pip install --no-deps --no-index --trusted-host=None --find-links=dotpython\wheelhouse --require-hashes -r "winpython\portable\cycle_2025_04\requir.64-3_13_5_1dotb3.txt" - - - name: List dotpython contents (for debugging) + - name: download requirements as hashed-requirements in dotpython\wheelhouse shell: pwsh run: | - Get-ChildItem -Recurse dotpython\wheelhouse + & "$env:build_location\python\python.exe" -m pip download --dest dotpython\wheelhouse --no-deps --require-hashes -r $env:WINPYrequirements - - name: List WPy64-31351cloudb3 contents (for debugging) + - name: install requirements as hashed-requirements from dotpython\wheelhouse shell: pwsh run: | - Get-ChildItem WPy64-31351b3 + & "$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 WPy64-31351cloudb3 Mardowned content (for debugging) + - name: List build_location Markdowned content (for debugging) shell: pwsh run: | - WPy64-31351b3\python\python.exe -m wppm -md + & "$env:build_location\python\python.exe" -m wppm -md #step avoided: upload-artifact will also .zip it (perplexity AI advising) #- name: Zip the result @@ -98,5 +117,5 @@ jobs: - name: Upload WinPython folder as artifact uses: actions/upload-artifact@v4 with: - name: WinPython64-3.13.5.1dotcloudb3 - path: WPy64-31351b3 + name: WinPython64-3.13.6.0dotcloudb3 + path: WPy64-31360b3