This repository provides a simple GitHub Actions workflow to build CPython for Windows (x64) from the official source tarballs on python.org.
You trigger the workflow manually, pass in a version like 3.12.10 or 3.12.12, and the pipeline will:
- Download the matching CPython source from
https://www.python.org/ftp/python/… - Build CPython with the official
PCbuildscripts (Release / x64) - Collect the build outputs
- Pack them into a highly compressed
.7z - Upload the
.7zas an artifact - Create a GitHub Release with the
.7zattached
The workflow file is located at:
.github/workflows/build-cpython.yml
It is triggered manually via workflow_dispatch and exposes one input:
-
python_version– CPython version to build- Example:
3.12.10,3.12.12
- Example:
Internally, this value is used to construct:
- Download URL:
https://www.python.org/ftp/python/<python_version>/Python-<python_version>.tgz - Source directory:
Python-<python_version> - Output archive name:
cpython-<python_version>-win64.7z - Release tag:
v<python_version>-win64
-
Enable GitHub Actions for this repository (if not already enabled).
-
Go to the Actions tab in GitHub.
-
Select “Build CPython (Windows)” workflow.
-
Click “Run workflow”.
-
In the dialog:
- Fill in
python_version, e.g.3.12.12. - Click “Run workflow”.
- Fill in
GitHub Actions will spin up a windows-latest runner and:
-
Download & extract the source.
-
Run:
get_externals.batbuild.bat -c Release -p x64
-
Copy build outputs from
PCbuild\amd64\intooutput\. -
Compress
output\into:cpython-<version>-win64.7z -
Upload the
.7zas an artifact. -
Create a Release with:
- Tag:
v<version>-win64 - Name:
CPython <version> for Windows x64 - Asset:
cpython-<version>-win64.7z
- Tag:
After a successful run, you will have:
-
Actions artifact
- Name:
cpython-<version>-win64 - File:
cpython-<version>-win64.7z
- Name:
-
GitHub Release
- Tag:
v<version>-win64 - Title:
CPython <version> for Windows x64 - Attached asset:
cpython-<version>-win64.7z
- Tag:
The .7z archive contains the built CPython binaries and related files from PCbuild\amd64\.
-
Target platform: Windows x64 (
-p x64inbuild.bat). -
Build type: Release (
-c Release). -
The workflow uses the official CPython Windows build system (
PCbuild). -
This is not an official distribution; it is intended for:
- Personal use
- Testing new patch versions
- Custom runtimes built from upstream source