Skip to content

Commit a701d67

Browse files
committed
Add manifest.json as the runtime source of truth
manifest.json now drives the CI build matrix (the setup job reads [.pythons[].full_version] from it) and is published as a release asset with the release date injected, so serious_python and flet consume a single consistent version set (CPython + pyodide + dart_bridge) keyed by release date instead of hand-mirroring versions.
1 parent 11699ee commit a701d67

3 files changed

Lines changed: 118 additions & 5 deletions

File tree

.github/workflows/build-python.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,28 @@ concurrency:
2121
cancel-in-progress: true
2222

2323
jobs:
24+
setup:
25+
name: Read build matrix from manifest
26+
runs-on: ubuntu-latest
27+
outputs:
28+
versions: ${{ steps.read.outputs.versions }}
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
- name: Extract Python versions from manifest.json
33+
id: read
34+
# manifest.json is the single source of truth: it both selects which
35+
# CPython versions are built here and is published as a release asset
36+
# (see publish-release) for serious_python / flet to consume.
37+
run: echo "versions=$(jq -c '[.pythons[].full_version]' manifest.json)" >> "$GITHUB_OUTPUT"
38+
2439
build-matrix:
2540
name: Build Python ${{ matrix.python_version }}
41+
needs: setup
2642
strategy:
2743
fail-fast: false
2844
matrix:
29-
python_version:
30-
- 3.12.13
31-
- 3.13.14
32-
- 3.14.6
45+
python_version: ${{ fromJSON(needs.setup.outputs.versions) }}
3346
uses: ./.github/workflows/build-python-version.yml
3447
with:
3548
python_version: ${{ matrix.python_version }}
@@ -44,17 +57,26 @@ jobs:
4457
# not touch GitHub releases.
4558
if: github.event_name == 'workflow_dispatch' && inputs.release_date != ''
4659
needs:
60+
- setup
4761
- build-matrix
4862
permissions:
4963
contents: write
5064
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@v4
67+
5168
- name: Download all build artifacts
5269
uses: actions/download-artifact@v8
5370
with:
5471
pattern: python-*
5572
path: release-artifacts
5673
merge-multiple: true
5774

75+
- name: Add runtime manifest (with release date) to the release
76+
# Publish the same manifest.json that drove this build, with the release
77+
# date injected, so consumers can fetch a consistent version set by date.
78+
run: jq '.release = "${{ inputs.release_date }}"' manifest.json > release-artifacts/manifest.json
79+
5880
- name: Publish all artifacts to release
5981
uses: softprops/action-gh-release@v3
6082
with:

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,66 @@
11
# python-build
2-
Building Python for Android and iOS
2+
3+
Builds the embedded CPython runtimes (Android, iOS, macOS, Linux, Windows) that
4+
[serious_python](https://github.com/flet-dev/serious-python) and
5+
[flet](https://github.com/flet-dev/flet) bundle into apps.
6+
7+
## `manifest.json` — the runtime source of truth
8+
9+
[`manifest.json`](manifest.json) is the single source of truth for a runtime
10+
release. It is used **both** ways:
11+
12+
- **Drives the build.** CI reads it to decide which CPython versions to build
13+
(the build matrix), so what gets built is exactly what the manifest lists.
14+
- **Is published.** Each release uploads the same `manifest.json` as a release
15+
asset (with the `release` date injected), so downstream tools fetch a single,
16+
consistent version set by date instead of hand-mirroring versions.
17+
18+
Schema:
19+
20+
```json
21+
{
22+
"release": "20260611", // injected at publish (= release tag)
23+
"default_python_version": "3.14",
24+
"dart_bridge_version": "1.2.3",
25+
"pythons": {
26+
"3.14": {
27+
"full_version": "3.14.6",
28+
"standalone_release_date": "20260610",
29+
"pyodide_version": "314.0.0",
30+
"pyodide_platform_tag": "pyemscripten-2026.0-wasm32",
31+
"prerelease": false
32+
}
33+
}
34+
}
35+
```
36+
37+
The committed file omits `release`; the publish step injects it.
38+
39+
### Adding or bumping a Python / Pyodide / dart_bridge version
40+
41+
Edit [`manifest.json`](manifest.json) and open a PR. The CI matrix updates
42+
automatically from it; per-version build specifics (ABIs, the 3.12 vs 3.13+ build
43+
method) live in the platform build scripts.
44+
45+
## Releases
46+
47+
Releases are date-keyed (`YYYYMMDD`) and cut manually:
48+
49+
1. Run the **Build Python Packages** workflow via `workflow_dispatch` with a
50+
`release_date` of `YYYYMMDD`.
51+
2. CI builds every Python in the manifest matrix, then publishes all per-platform
52+
tarballs **and** `manifest.json` (with `release` set) to a GitHub release tagged
53+
with that date.
54+
55+
A push without a `release_date` still exercises the full matrix but publishes no
56+
release (per-job artifacts only).
57+
58+
## Consumers
59+
60+
- **serious_python** pins a release date, fetches that release's `manifest.json`,
61+
and generates committed per-platform version tables from it.
62+
- **flet** fetches the manifest by date for commands that run without serious_python
63+
(e.g. `flet publish`).
64+
65+
See platform-specific notes under [`android/`](android/README.md),
66+
[`darwin/`](darwin/README.rst), `linux/`, and `windows/`.

manifest.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"default_python_version": "3.14",
3+
"dart_bridge_version": "1.2.3",
4+
"pythons": {
5+
"3.12": {
6+
"full_version": "3.12.13",
7+
"standalone_release_date": "20260610",
8+
"pyodide_version": "0.27.7",
9+
"pyodide_platform_tag": "pyodide-2024.0-wasm32",
10+
"prerelease": false
11+
},
12+
"3.13": {
13+
"full_version": "3.13.14",
14+
"standalone_release_date": "20260610",
15+
"pyodide_version": "0.29.4",
16+
"pyodide_platform_tag": "pyemscripten-2025.0-wasm32",
17+
"prerelease": false
18+
},
19+
"3.14": {
20+
"full_version": "3.14.6",
21+
"standalone_release_date": "20260610",
22+
"pyodide_version": "314.0.0",
23+
"pyodide_platform_tag": "pyemscripten-2026.0-wasm32",
24+
"prerelease": false
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)