Build source-based, portable CPython archives for multiple OS/architecture targets, validate the packaged standard library, and publish reproducible release artifacts through GitHub Actions.
This repository automates a full release loop for portable Python distributions:
- Resolve latest CPython patch versions for configured major lines.
- Build per-target archives from source.
- Validate packaged interpreters with both fast and full stdlib checks.
- Publish artifacts and checksums to GitHub Releases.
- Commit release snapshots under
release-state/for traceability.
Supported build targets:
- Windows x86_64
- Linux x86_64
- macOS x86_64
- macOS arm64
Configured major lines live in config/majors.json.
- Source builds from python.org release tarballs.
- Checksummed source download metadata recorded in each artifact
METADATA.json. - CPython tag and tag commit SHA tracking in packaged metadata.
- Stdlib validation gates that fail release runs on unexpected import regressions.
- Automatic release-state history snapshots for each published tag.
- Manual targeted rebuild support in GitHub Actions (major, OS, arch filters).
Build latest patch for a major line:
python scripts/build_portable.py 3.13Build explicit version and target:
python scripts/build_portable.py \
3.11 \
--python-version 3.11.15 \
--target-os macos \
--target-arch x86_64 \
--output-dir distRun full archive validation:
python scripts/validate_distribution.py \
dist/python-3.11.15-macos-x86_64.tar.gz \
--baseline-python python3 \
--full-timeout-seconds 5Run checker directly inside any Python runtime:
python scripts/check_stdlib.py --mode fast
python scripts/check_stdlib.py --mode full --timeout-seconds 5Main release workflow:
.github/workflows/build-python.yml
- Resolves latest patch versions for configured majors.
- Compares with
release-state/latest.json. - Builds only changed majors by default.
- Validates each built archive with fast/full checks.
- Publishes artifacts and checksums.
- Commits updated release-state snapshot files.
- Creates or updates release tag/release assets.
force_rebuild: rebuild even when no upstream patch changed.release_tag: optional release tag override.major_filter: optional single major filter (example:3.11).target_os_filter:any,linux,windows, ormacos.target_arch_filter:any,x86_64, orarm64.
If any target filter is set, the workflow automatically enables force planning so you can rebuild a selected slice even when upstream versions are unchanged.
To rebuild only CPython 3.11 for macOS Intel:
major_filter=3.11target_os_filter=macostarget_arch_filter=x86_64
This is the recommended path for patching one broken artifact without rebuilding every version/target.
scripts/resolve_latest_patch.pyqueriespython/cpythontags and resolves latest patch versions for each configured major.
scripts/plan_release.pycompares resolved versions againstrelease-state/latest.jsonand decides whether to build.
scripts/build_portable.pydownloads source, verifies checksum when available, builds CPython, packages archive, and writesMETADATA.json.- On macOS, runtime dylib dependencies are bundled to improve portability.
- CPython 3.11 on macOS prefers Homebrew
tcl-tk@8for reliable_tkinterbuilds.
scripts/check_stdlib.pyperforms fast and full import checks.scripts/validate_distribution.pyextracts an archive and enforces validation gates used by CI.
scripts/update_release_state.pywritesrelease-state/latest.jsonplusrelease-state/history/*.jsonsnapshots.
scripts/build_portable.py: Build and package portable Python archives.scripts/check_stdlib.py: Import-check stdlib modules in fast/full modes.scripts/validate_distribution.py: Validate packaged archive and optional stdlib set comparison.scripts/resolve_latest_patch.py: Resolve latest CPython patch tags per major.scripts/plan_release.py: Compute build/release plan from resolved versions and current state.scripts/update_release_state.py: Persist latest/history release-state snapshots.
python-builds/
|-- .github/workflows/ # Build, validation, and release automation
|-- config/majors.json # Major version lines to track
|-- scripts/ # Build/validation/planning tooling
|-- release-state/ # Committed release snapshots
| |-- latest.json
| `-- history/*.json
`-- README.md
- Artifacts include
python/plusMETADATA.json. - Linux and macOS archives are
.tar.gz; Windows archives are.zip. - Workflow releases use release-state snapshots as the source of truth for what changed.