less code, more parameters #3
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 for 2026-01 Cycle | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| python_versionf: | ||
| description: 'Python version to build (3.13, 3.14, 3.14F or 3.15)' | ||
| required: true | ||
| default: '3.14' | ||
| type: choice | ||
| options: | ||
| - '3.13' | ||
| - '3.14' | ||
| - '3.14F' | ||
| - '3.15' | ||
| env: | ||
| # === Global Configuration === | ||
| WINPYARCH: "64" | ||
| my_release_level: "b0" | ||
| dotwheelhouse: dotpython\\wheelhouse\\included.wheels | ||
| pandoc_source: "https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-windows-x86_64.zip" | ||
| pandoc_sha256: "11eb6dbe5286c9e5edb0cca4412e7d99ec6578ec04158b0b7fe11f7fd96688e5" | ||
| jobs: | ||
| build-winpython: | ||
| runs-on: windows-latest | ||
| strategy: | ||
| fail-fast: true | ||
| matrix: | ||
| flavor: | ||
| - name: "dot" | ||
| REQUIREMENTS_313: "winpython\\portable\\cycle_2025_05\\requir.64-3_13_11_0dot.txt" | ||
| REQUIREMENTS_314: "winpython\\portable\\cycle_2025_05\\requir.64-3_14_2_0dot.txt" | ||
| REQUIREMENTS_315: "winpython\\portable\\cycle_2025_05\\requir.64-3_15_0_0dot.txt" | ||
| REQUIREMENTS_WHL_313: "" | ||
| REQUIREMENTS_WHL_314: "" | ||
| REQUIREMENTS_WHL_315: "" | ||
| formats: { zip: true, 7z: false, exe: true } | ||
| PANDOC: "0" | ||
| WINPYARCHDET: "64" | ||
| - name: "slim" | ||
| REQUIREMENTS_313: "winpython\\portable\\cycle_2025_05\\requir.64-3_13_11_0slim.txt" | ||
| REQUIREMENTS_314: "winpython\\portable\\cycle_2025_05\\requir.64-3_14_2_0slim.txt" | ||
| REQUIREMENTS_315: "" | ||
| REQUIREMENTS_WHL_313: "" | ||
| REQUIREMENTS_WHL_314: "" | ||
| REQUIREMENTS_WHL_315: "" | ||
| formats: { zip: false, 7z: true, exe: true } | ||
| PANDOC: "1" | ||
| WINPYARCHDET: "64" | ||
| - name: "whl" | ||
| REQUIREMENTS_313: "winpython\\portable\\cycle_2025_05\\requir.64-3_13_11_0dot.txt" | ||
| REQUIREMENTS_314: "winpython\\portable\\cycle_2025_05\\requir.64-3_14_2_0dot.txt" | ||
| REQUIREMENTS_315: "" | ||
| REQUIREMENTS_WHL_313: "winpython\\portable\\cycle_2025_05\\requir.64-3_13_11_0whl_wheels.txt" | ||
| REQUIREMENTS_WHL_314: "winpython\\portable\\cycle_2025_05\\requir.64-3_14_2_0whl_wheels.txt" | ||
| REQUIREMENTS_WHL_315: "" | ||
| formats: { zip: false, 7z: true, exe: false } | ||
| PANDOC: "0" | ||
| WINPYARCHDET: "64" | ||
| - name: "free" | ||
| REQUIREMENTS_313: "" | ||
| REQUIREMENTS_314: "winpython\\portable\\cycle_2025_05\\requir.64-3_14_2_0free.txt" | ||
| REQUIREMENTS_315: "" | ||
| REQUIREMENTS_WHL_313: "" | ||
| REQUIREMENTS_WHL_314: "" | ||
| REQUIREMENTS_WHL_315: "" | ||
| formats: { zip: true, 7z: false, exe: true } | ||
| PANDOC: "0" | ||
| WINPYARCHDET: "64F" | ||
| - name: "slimf" | ||
| REQUIREMENTS_313: "" | ||
| REQUIREMENTS_314: "winpython\\portable\\cycle_2025_05\\requir.64-3_14_2_0slimf.txt" | ||
| REQUIREMENTS_315: "" | ||
| REQUIREMENTS_WHL_313: "" | ||
| REQUIREMENTS_WHL_314: "" | ||
| REQUIREMENTS_WHL_315: "" | ||
| formats: { zip: false, 7z: true, exe: true } | ||
| PANDOC: "1" | ||
| WINPYARCHDET: "64F" | ||
| # use the workflow input as the python_version matrix (single value) | ||
| python_versionf: [ ${{ github.event.inputs.python_versionf }} ] | ||
| include: | ||
| # Configuration for 3.13 | ||
| - python_versionf: "3.13" | ||
| ver2: "3.13.11.1" | ||
| v_tag: "3_13_11_" | ||
| src: "https://github.com/astral-sh/python-build-standalone/releases/download/20251205/cpython-3.13.11+20251205-x86_64-pc-windows-msvc-install_only_stripped.tar.gz" | ||
| sha: "d8a2b5e05ef71fc71f048a6f409d69b940bc5d33da8b112611cfba68fc5b86c3" | ||
| # Configuration for 3.14 (Standard) | ||
| - python_versionf: "3.14" | ||
| ver2: "3.14.2.1" | ||
| v_tag: "3_14_2_" | ||
| src: "https://github.com/astral-sh/python-build-standalone/releases/download/20251205/cpython-3.14.2+20251205-x86_64-pc-windows-msvc-install_only_stripped.tar.gz" | ||
| sha: "512744d8a86dc6042a712035ada5d87c5e2ce4218f5dbdc74d039cee46e76fb4" | ||
| # Configuration for 3.14 (Free-threading override of flavor) | ||
| - python_versionf: "3.14F" | ||
| ver2: "3.14.2.1" | ||
| v_tag: "3_14_2_" | ||
| src: "https://github.com/astral-sh/python-build-standalone/releases/download/20251205/cpython-3.14.2+20251205-x86_64-pc-windows-msvc-freethreaded+pgo-full.tar.zst" | ||
| sha: "536cf813857ea566fcfae18a1b7dbcd185385f1dc1f04d5a0951bad235c8fc61" | ||
| # Configuration for 3.15 | ||
| - python_versionf: "3.15" | ||
| ver2: "3.15.0.1" | ||
| v_tag: "3_15_0_" | ||
| src: "https://github.com/astral-sh/python-build-standalone/releases/download/20251217/cpython-3.15.0a3+20251217-x86_64-pc-windows-msvc-install_only_stripped.tar.gz" | ||
| sha: "4cac37170050bb402eaabad84e7ceb4679ec8ffaf43fbea71d62651ca761dcd7" | ||
| env: | ||
| PYTHON_VERSIONF: ${{ github.event.inputs.python_versionf }} | ||
| PYTHON_VERSION: ${{ replace(matrix.python_versionf, 'F', '') }} | ||
| detected_arch: ${{ contains(matrix.python_versionf, 'F') && '64F' || '64' }} | ||
| WINPYFLAVOR: ${{ matrix.flavor.name }} | ||
| PANDOC: ${{ matrix.flavor.PANDOC }} | ||
| WINPYARCHDET: ${{ matrix.flavor.WINPYARCHDET }} | ||
| WINPYVER2: ${{ matrix.ver2 }} | ||
| build_location: WPy64-${{ replace(matrix.ver2, '.', '') }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set static and matrix variables based on selected Python version | ||
| shell: bash | ||
| run: | | ||
| PYTHON_VERSION="${{ env.PYTHON_VERSION }}" | ||
| WINPYARCHDET="${{ env.WINPYARCHDET }}" | ||
| detected_arch="${{ env.detected_arch }}" | ||
| WINPYVER2="${{ env.WINPYVER2 }}" | ||
| WINPYVERSION=${PYTHON_VERSION//./} | ||
| echo "WINPYVERSION=$WINPYVERSION" >> $GITHUB_ENV | ||
| # Populate generic per-flavor / per-version selections | ||
| if [ "$PYTHON_VERSION" = "3.13" ]; then | ||
| echo "WINPYREQUIREMENTS=${{ matrix.flavor.REQUIREMENTS_313 }}" >> $GITHUB_ENV | ||
| echo "WINPYREQUIREMENTSwhl=${{ matrix.flavor.REQUIREMENTS_WHL_313 }}" >> $GITHUB_ENV | ||
| elif [ "$PYTHON_VERSION" = "3.14" ] && [ "$WINPYARCHDET" = "$detected_arch" ]; then | ||
| echo "WINPYREQUIREMENTS=${{ matrix.flavor.REQUIREMENTS_314 }}" >> $GITHUB_ENV | ||
| echo "WINPYREQUIREMENTSwhl=${{ matrix.flavor.REQUIREMENTS_WHL_314 }}" >> $GITHUB_ENV | ||
| elif [ "$PYTHON_VERSION" = "3.15" ]; then | ||
| echo "WINPYREQUIREMENTS=${{ matrix.flavor.REQUIREMENTS_315 }}" >> $GITHUB_ENV | ||
| echo "WINPYREQUIREMENTSwhl=${{ matrix.flavor.REQUIREMENTS_WHL_315 }}" >> $GITHUB_ENV | ||
| fi | ||
| # write common flavor env vars | ||
| echo "ARTIFACT_NAME=publish_${PYTHON_VERSION}${{ matrix.flavor.name }}" >> $GITHUB_ENV | ||
| echo "destwheelhouse=${{ env.build_location }}\\wheelhouse\\included.wheels" >> $GITHUB_ENV | ||
| echo "WINPYVER=${WINPYVER2}${{ matrix.flavor.name }}${{ env.my_release_level }}" >> $GITHUB_ENV | ||
| - name: Download, verify and extract python standalone | ||
| if: env.WINPYREQUIREMENTS != '' | ||
| uses: ./.github/actions/python-setup | ||
| with: | ||
| python_source: ${{ matrix.src }} | ||
| python_sha256: ${{ matrix.sha }} | ||
| build_location: ${{ env.build_location }} | ||
| - name: Download, checking hash and integrating pandoc binary | ||
| if: env.WINPYREQUIREMENTS != '' && env.PANDOC == '1' | ||
| uses: ./.github/actions/pandoc-setup | ||
| with: | ||
| pandoc_source: ${{ env.pandoc_source }} | ||
| pandoc_sha256: ${{ env.pandoc_sha256 }} | ||
| build_location: ${{ env.build_location }} | ||
| - name: Upgrade pip and patch launchers | ||
| if: env.WINPYREQUIREMENTS != '' | ||
| shell: pwsh | ||
| run: | | ||
| & "$env:build_location\python\python.exe" -m pip install --upgrade --force-reinstall pip | ||
| & "$env:build_location\python\python.exe" -m pip install --upgrade packaging==25.0 | ||
| & "$env:build_location\python\python.exe" -c "from wppm import wppm;dist=wppm.Distribution();dist.patch_standard_packages('pip', to_movable=True)" | ||
| - name: Download all requirements | ||
| if: ${{ env.WINPYREQUIREMENTS != '' }} | ||
| shell: pwsh | ||
| run: | | ||
| $py = "$env:build_location\python\python.exe" | ||
| & $py -m pip download --dest $env:dotwheelhouse --no-deps --require-hashes -r $env:WINPYREQUIREMENTS | ||
| if ($env:WINPYREQUIREMENTSwhl -ne '') { | ||
| & $py -m pip download --dest $env:destwheelhouse --no-deps --require-hashes -r $env:WINPYREQUIREMENTSwhl | ||
| } | ||
| - name: Install requirements | ||
| if: env.WINPYREQUIREMENTS != '' | ||
| shell: pwsh | ||
| run: | | ||
| & "$env:build_location\python\python.exe" -m pip install --no-deps --no-index --trusted-host=None --find-links=$env:dotwheelhouse --require-hashes -r $env:WINPYREQUIREMENTS | ||
| - name: Generate Assets and Hashes | ||
| if: env.WINPYREQUIREMENTS != '' | ||
| uses: ./.github/actions/publish-winpython | ||
| with: | ||
| build_location: ${{ env.build_location }} | ||
| winpy_flavor: ${{ env.WINPYFLAVOR }} | ||
| winpy_arch: ${{ env.WINPYARCH }} | ||
| winpy_ver: ${{ env.WINPYVER }} | ||
| winpy_ver2: ${{ env.WINPYVER2 }} | ||
| dotwheelhouse: ${{ env.dotwheelhouse }} | ||
| winpy_requirements_whl: ${{ env.WINPYREQUIREMENTSwhl }} | ||
| format_zip: ${{ matrix.flavor.formats.zip }} | ||
| format_7z: ${{ matrix.flavor.formats['7z'] }} | ||
| format_exe: ${{ matrix.flavor.formats.exe }} | ||
| - name: Upload artifacts | ||
| if: env.WINPYREQUIREMENTS != '' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ env.ARTIFACT_NAME }} | ||
| path: publish_output | ||
| retention-days: 66 # keeps artifact for 66 days | ||