python: 3.12.6 and 3.8.20 #57
This file contains 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 | |
on: | |
push: {} | |
pull_request: {} | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: x64 | |
cpython_branch: "3.12" | |
cpython_commit: a4a2d2b0d85273f746c3834ce2753e19c898949d | |
os: windows-2022 | |
- arch: x86 | |
cpython_branch: "3.12" | |
cpython_commit: a4a2d2b0d85273f746c3834ce2753e19c898949d | |
os: windows-2022 | |
- arch: x64 | |
cpython_branch: "3.8" | |
cpython_commit: 39b2f82717a69dde7212bc39b673b0f55c99e6a3 | |
os: windows-2019 | |
- arch: x86 | |
cpython_branch: "3.8" | |
cpython_commit: 39b2f82717a69dde7212bc39b673b0f55c99e6a3 | |
os: windows-2019 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Get cpython | |
shell: bash | |
run: | | |
git init cpython | |
git -C cpython remote add origin https://github.com/python/cpython.git | |
git -C cpython fetch \ | |
--depth=1000 \ | |
--progress \ | |
origin \ | |
'+refs/heads/${{ matrix.cpython_branch }}:refs/remotes/origin/${{ matrix.cpython_branch }}' \ | |
'+refs/tags/v${{ matrix.cpython_branch }}.*:refs/tags/v${{ matrix.cpython_branch }}.*' | |
git -C cpython checkout '${{ matrix.cpython_commit }}' | |
- name: Get vars | |
id: vars | |
shell: pwsh | |
run: | | |
$d = (.\cpython\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }}; | |
echo ("python_version=" + $d.PythonVersion) >> $env:GITHUB_OUTPUT | |
echo ("git_version=" + (git -C cpython describe --tags --long)) >> $env:GITHUB_OUTPUT | |
# - name: Get external libs (sources) | |
# shell: pwsh | |
# run: | | |
# .\cpython\PCbuild\get_externals.bat ` | |
# --no-tkinter ` | |
# --tkinter-src ` | |
# --no-openssl ` | |
# --openssl-src ` | |
# --no-libffi ` | |
# --libffi-src | |
# | |
# # prepare_tcltk.bat (only build for the arch we're interested in) | |
# - name: Build Tcl/Tk | |
# shell: pwsh | |
# run: | | |
# $env:MSBUILD = (cmd /v:on /c "call .\cpython\PCbuild\find_msbuild.bat >nul && echo !MSBUILD!") | |
# & $env:MSBUILD ` | |
# .\cpython\PCbuild\tcl.vcxproj ` | |
# /p:Configuration=Release ` | |
# /p:Platform=$platform | |
# & $env:MSBUILD ` | |
# .\cpython\PCbuild\tk.vcxproj ` | |
# /p:Configuration=Release ` | |
# /p:Platform=$platform | |
# & $env:MSBUILD ` | |
# .\cpython\PCbuild\tix.vcxproj ` | |
# /p:Configuration=Release ` | |
# /p:Platform=$platform | |
# | |
# # prepare_ssl.bat (only build for the arch we're interested in) | |
# - name: Build OpenSSL | |
# shell: pwsh | |
# run: | | |
# $platform = If ("${{ matrix.arch }}" -eq "x86") {"Win32"} else {"${{ matrix.arch }}"} | |
# $env:MSBUILD = (cmd /v:on /c "call .\cpython\PCbuild\find_msbuild.bat >nul && echo !MSBUILD!") | |
# $env:PYTHON = (Get-Command python.exe).Path | |
# $env:PERL = (Get-Command perl.exe).Path | |
# & $env:MSBUILD ` | |
# .\cpython\PCbuild\openssl.vcxproj ` | |
# /p:Configuration=Release ` | |
# /p:Platform=$platform | |
# | |
# # prepare_libffi.bat | |
# - uses: cygwin/cygwin-install-action@ad81540ad7c2726e17c08401fbeca6380cc7f463 | |
# with: | |
# platform: x86_64 | |
# packages: make,autoconf,automake,libtool,dejagnu | |
# - name: Build libffi | |
# shell: pwsh | |
# run: | | |
# $env:LIBFFI_SOURCE = (Resolve-Path .\cpython\externals\libffi-*).Path | |
# $env:SH = "C:\cygwin\bin\sh.exe" | |
# .\cpython\PCbuild\prepare_libffi.bat -${{ matrix.arch }} -license | |
- name: Get external libs (pre-built binaries) | |
shell: pwsh | |
run: | | |
.\cpython\PCbuild\get_externals.bat | |
- name: Build | |
shell: pwsh | |
run: | | |
$platform = "${{ matrix.arch }}" -eq "x86" ? "Win32" : "${{ matrix.arch }}" | |
.\cpython\PCbuild\build.bat -v -c Release -p $platform | |
- name: Package | |
shell: pwsh | |
run: | | |
$platform = "${{ matrix.arch }}" -eq "x86" ? "win32" : "amd64" | |
& (".\cpython\PCbuild\" + $platform + "\python.exe") ` | |
.\cpython\PC\layout ` | |
-vv ` | |
--source .\cpython ` | |
--build .\cpython\PCbuild\$platform ` | |
--arch $platform ` | |
--temp .\temp ` | |
--precompile ` | |
--include-underpth ` | |
--zip-lib ` | |
--zip "python-${{ steps.vars.outputs.git_version }}-windows-${{ matrix.arch }}-embed.zip" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: python-${{ steps.vars.outputs.git_version }}-windows-${{ matrix.arch }}-embed | |
path: ./*.zip | |
deploy: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- run: mkdir dist | |
- uses: actions/download-artifact@v4 | |
with: | |
path: ./dist | |
- run: ./deploy.sh ./dist/**/*.zip | |
env: | |
RELEASES_API_KEY: ${{ secrets.GITHUB_TOKEN }} |