Skip to content

Commit 28863d5

Browse files
authored
Create update-platform-support.yml
Signed-off-by: 1minds3t <1minds3t@proton.me>
1 parent 8bfd16b commit 28863d5

1 file changed

Lines changed: 382 additions & 0 deletions

File tree

Lines changed: 382 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,382 @@
1+
# .github/workflows/update-platform-support.yml
2+
name: Update Platform Support Matrix
3+
4+
on:
5+
workflow_run:
6+
workflows: ["Cross-Platform Build Verification"]
7+
types:
8+
- completed
9+
workflow_dispatch:
10+
11+
jobs:
12+
update-matrix:
13+
name: Generate Platform Support Table
14+
runs-on: ubuntu-latest
15+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.11'
25+
26+
- name: Fetch workflow results
27+
id: fetch
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
run: |
31+
# Get the latest successful workflow run
32+
RUN_ID=$(gh run list --workflow="Cross-Platform Build Verification" \
33+
--status=success --limit=1 --json databaseId --jq '.[0].databaseId')
34+
35+
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
36+
37+
# Fetch job results
38+
gh run view $RUN_ID --json jobs > workflow-jobs.json
39+
40+
echo "✅ Fetched workflow results for run #$RUN_ID"
41+
42+
- name: Parse platform results
43+
id: parse
44+
run: |
45+
python3 << 'PYTHON_SCRIPT'
46+
import json
47+
import sys
48+
49+
# Load workflow jobs
50+
with open('workflow-jobs.json', 'r') as f:
51+
data = json.load(f)
52+
53+
# Platform mapping
54+
platforms = {
55+
# Self-hosted
56+
"Linux x86_64 (self-hosted)": {
57+
"os": "Linux",
58+
"arch": "x86_64",
59+
"type": "bare-metal",
60+
"notes": "Native installation"
61+
},
62+
"macOS x86_64 Intel (self-hosted)": {
63+
"os": "macOS",
64+
"arch": "x86_64 (Intel)",
65+
"type": "bare-metal",
66+
"notes": "Native installation"
67+
},
68+
69+
# GitHub-hosted
70+
"Ubuntu x86_64": {
71+
"os": "Ubuntu",
72+
"arch": "x86_64",
73+
"type": "GitHub Actions",
74+
"notes": "Latest LTS"
75+
},
76+
"Windows x86_64": {
77+
"os": "Windows",
78+
"arch": "x86_64",
79+
"type": "GitHub Actions",
80+
"notes": "Latest Server"
81+
},
82+
83+
# Docker/Podman - Debian family
84+
"Docker - Debian/Ubuntu (debian:12)": {
85+
"os": "Debian 12 (Bookworm)",
86+
"arch": "x86_64",
87+
"type": "container",
88+
"notes": "Standard install"
89+
},
90+
"Docker - Debian/Ubuntu (debian:11)": {
91+
"os": "Debian 11 (Bullseye)",
92+
"arch": "x86_64",
93+
"type": "container",
94+
"notes": "Standard install"
95+
},
96+
"Docker - Debian/Ubuntu (ubuntu:24.04)": {
97+
"os": "Ubuntu 24.04 (Noble)",
98+
"arch": "x86_64",
99+
"type": "container",
100+
"notes": "`--break-system-packages` required"
101+
},
102+
"Docker - Debian/Ubuntu (ubuntu:22.04)": {
103+
"os": "Ubuntu 22.04 (Jammy)",
104+
"arch": "x86_64",
105+
"type": "container",
106+
"notes": "Standard install"
107+
},
108+
"Docker - Debian/Ubuntu (ubuntu:20.04)": {
109+
"os": "Ubuntu 20.04 (Focal)",
110+
"arch": "x86_64",
111+
"type": "container",
112+
"notes": "Standard install"
113+
},
114+
115+
# Podman - Debian family
116+
"Podman - debian:12": {
117+
"os": "Debian 12 (Bookworm)",
118+
"arch": "x86_64",
119+
"type": "podman",
120+
"notes": "`--break-system-packages` required"
121+
},
122+
"Podman - ubuntu:24.04": {
123+
"os": "Ubuntu 24.04 (Noble)",
124+
"arch": "x86_64",
125+
"type": "podman",
126+
"notes": "`--break-system-packages` required"
127+
},
128+
"Podman - fedora:39": {
129+
"os": "Fedora 39",
130+
"arch": "x86_64",
131+
"type": "podman",
132+
"notes": "Standard install"
133+
},
134+
135+
# RHEL family
136+
"Docker - RHEL/Fedora (fedora:39)": {
137+
"os": "Fedora 39",
138+
"arch": "x86_64",
139+
"type": "container",
140+
"notes": "Standard install"
141+
},
142+
"Docker - RHEL/Fedora (fedora:38)": {
143+
"os": "Fedora 38",
144+
"arch": "x86_64",
145+
"type": "container",
146+
"notes": "Standard install"
147+
},
148+
"Docker - RHEL/Fedora (rockylinux:9)": {
149+
"os": "Rocky Linux 9",
150+
"arch": "x86_64",
151+
"type": "container",
152+
"notes": "Standard install"
153+
},
154+
"Docker - RHEL/Fedora (rockylinux:8)": {
155+
"os": "Rocky Linux 8",
156+
"arch": "x86_64",
157+
"type": "container",
158+
"notes": "Requires Python 3.9+ (default is 3.6)"
159+
},
160+
"Docker - RHEL/Fedora (almalinux:9)": {
161+
"os": "AlmaLinux 9",
162+
"arch": "x86_64",
163+
"type": "container",
164+
"notes": "Standard install"
165+
},
166+
167+
# Other distros
168+
"Docker - Arch/Alpine (archlinux:latest)": {
169+
"os": "Arch Linux",
170+
"arch": "x86_64",
171+
"type": "container",
172+
"notes": "`--break-system-packages` required"
173+
},
174+
"Docker - Arch/Alpine (alpine:latest)": {
175+
"os": "Alpine Linux",
176+
"arch": "x86_64",
177+
"type": "container",
178+
"notes": "Requires build deps (gcc, musl-dev)"
179+
}
180+
}
181+
182+
# Parse job results
183+
results = {}
184+
for job in data['jobs']:
185+
job_name = job['name']
186+
status = job['conclusion']
187+
188+
if job_name in platforms:
189+
platform_info = platforms[job_name]
190+
platform_info['status'] = status
191+
platform_info['runtime'] = job.get('completedAt', 'N/A')
192+
results[job_name] = platform_info
193+
194+
# Save results
195+
with open('.github/platform-results.json', 'w') as f:
196+
json.dump(results, f, indent=2)
197+
198+
# Count successes
199+
success_count = sum(1 for p in results.values() if p['status'] == 'success')
200+
total_count = len(results)
201+
202+
print(f"✅ {success_count}/{total_count} platforms verified")
203+
204+
# Output for GitHub Actions
205+
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
206+
f.write(f"success_count={success_count}\n")
207+
f.write(f"total_count={total_count}\n")
208+
PYTHON_SCRIPT
209+
210+
- name: Generate platform support table
211+
run: |
212+
python3 << 'PYTHON_SCRIPT'
213+
import json
214+
215+
with open('.github/platform-results.json', 'r') as f:
216+
results = json.load(f)
217+
218+
# Group by OS family
219+
grouped = {
220+
"Linux (Native)": [],
221+
"macOS (Native)": [],
222+
"Windows (Native)": [],
223+
"Debian/Ubuntu": [],
224+
"RHEL/Fedora": [],
225+
"Other Linux": []
226+
}
227+
228+
for job_name, info in results.items():
229+
os_name = info['os']
230+
231+
if info['type'] == 'bare-metal' and 'Linux' in os_name:
232+
grouped["Linux (Native)"].append((job_name, info))
233+
elif info['type'] == 'bare-metal' and 'macOS' in os_name:
234+
grouped["macOS (Native)"].append((job_name, info))
235+
elif info['type'] == 'GitHub Actions' and 'Windows' in os_name:
236+
grouped["Windows (Native)"].append((job_name, info))
237+
elif 'Ubuntu' in os_name or 'Debian' in os_name:
238+
grouped["Debian/Ubuntu"].append((job_name, info))
239+
elif any(x in os_name for x in ['Fedora', 'Rocky', 'Alma']):
240+
grouped["RHEL/Fedora"].append((job_name, info))
241+
else:
242+
grouped["Other Linux"].append((job_name, info))
243+
244+
# Generate markdown table
245+
md_lines = [
246+
"<!-- PLATFORM_SUPPORT_START -->",
247+
"## 🌐 Verified Platform Support",
248+
"",
249+
f"[![Platforms Verified](https://img.shields.io/badge/platforms-{len(results)}%20verified-success?logo=linux&logoColor=white)](https://github.com/1minds3t/omnipkg/actions/workflows/cross-platform-build-verification.yml)",
250+
"",
251+
"**omnipkg** is a pure Python package (noarch) with **no C-extensions**, ensuring universal compatibility across all platforms and architectures.",
252+
"",
253+
"### 📊 Platform Matrix",
254+
""
255+
]
256+
257+
for group_name, platforms in grouped.items():
258+
if not platforms:
259+
continue
260+
261+
md_lines.append(f"#### {group_name}")
262+
md_lines.append("")
263+
md_lines.append("| Platform | Architecture | Status | Installation Notes |")
264+
md_lines.append("|----------|--------------|--------|-------------------|")
265+
266+
for job_name, info in platforms:
267+
status_badge = "✅" if info['status'] == 'success' else "❌"
268+
os_name = info['os']
269+
arch = info['arch']
270+
notes = info['notes']
271+
272+
md_lines.append(f"| {os_name} | {arch} | {status_badge} | {notes} |")
273+
274+
md_lines.append("")
275+
276+
# Add special notes section
277+
md_lines.extend([
278+
"### 📝 Special Installation Notes",
279+
"",
280+
"#### Ubuntu 24.04+ / Debian 12+ (PEP 668)",
281+
"```bash",
282+
"# Use --break-system-packages flag",
283+
"python3 -m pip install --break-system-packages omnipkg",
284+
"```",
285+
"",
286+
"#### Rocky/Alma Linux 8 (Python 3.6 → 3.9)",
287+
"```bash",
288+
"# Install Python 3.9 first",
289+
"sudo dnf install -y python39 python39-pip",
290+
"sudo ln -sf /usr/bin/python3.9 /usr/bin/python3",
291+
"",
292+
"# Then install omnipkg",
293+
"python3 -m pip install omnipkg",
294+
"```",
295+
"",
296+
"#### Alpine Linux (Build Dependencies)",
297+
"```bash",
298+
"# Install build tools for psutil",
299+
"apk add --no-cache gcc python3-dev musl-dev linux-headers",
300+
"python3 -m pip install --break-system-packages omnipkg",
301+
"```",
302+
"",
303+
"#### Arch Linux",
304+
"```bash",
305+
"python -m pip install --break-system-packages omnipkg",
306+
"```",
307+
"",
308+
"### 🐍 Python Version Support",
309+
"",
310+
"**Supported:** Python 3.7 - 3.14 (including beta/rc releases)",
311+
"",
312+
"**Architecture:** `noarch` (pure Python, no compiled extensions)",
313+
"",
314+
"This means omnipkg runs on **any** architecture where Python is available:",
315+
"- ✅ x86_64 (Intel/AMD)",
316+
"- ✅ ARM32 (armv6/v7) via [piwheels](https://www.piwheels.org/project/omnipkg/)",
317+
"- ✅ ARM64 (aarch64) - native Python support",
318+
"- ✅ RISC-V, POWER, s390x - anywhere Python runs!",
319+
"",
320+
"<!-- PLATFORM_SUPPORT_END -->"
321+
])
322+
323+
# Write to file
324+
with open('.github/platform-support.md', 'w') as f:
325+
f.write('\n'.join(md_lines))
326+
327+
print("✅ Platform support table generated")
328+
PYTHON_SCRIPT
329+
330+
- name: Update README
331+
run: |
332+
# Check if markers exist in README
333+
if grep -q "<!-- PLATFORM_SUPPORT_START -->" README.md; then
334+
# Remove old content between markers
335+
perl -i -p0e 's/<!-- PLATFORM_SUPPORT_START -->.*?<!-- PLATFORM_SUPPORT_END -->//gs' README.md
336+
337+
# Find insertion point (after "## 🛠️ Get Started in 30 Seconds" section)
338+
# Insert new platform support table before installation options
339+
sed -i '/### Installation Options/e cat .github/platform-support.md' README.md
340+
else
341+
echo "⚠️ Platform support markers not found in README.md"
342+
echo "Please add <!-- PLATFORM_SUPPORT_START --> and <!-- PLATFORM_SUPPORT_END --> markers"
343+
fi
344+
345+
- name: Commit changes
346+
run: |
347+
git config user.name "github-actions[bot]"
348+
git config user.email "github-actions[bot]@users.noreply.github.com"
349+
350+
git add README.md .github/platform-support.md .github/platform-results.json || true
351+
352+
if ! git diff --staged --quiet; then
353+
git commit -m "Auto-update platform support matrix [skip ci]"
354+
git pull --rebase origin main
355+
git push
356+
else
357+
echo "No changes to commit"
358+
fi
359+
360+
- name: Generate summary
361+
run: |
362+
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
363+
## 🌐 Platform Support Updated
364+
365+
**Verified Platforms:** ${{ steps.parse.outputs.success_count }}/${{ steps.parse.outputs.total_count }}
366+
367+
**Categories:**
368+
- Native Linux (x86_64)
369+
- Native macOS (Intel x86_64)
370+
- Native Windows (x86_64)
371+
- Debian/Ubuntu (12+ container distros)
372+
- RHEL/Fedora (5 distros)
373+
- Arch Linux & Alpine Linux
374+
375+
**Architecture Support:**
376+
- ✅ x86_64 (verified in CI)
377+
- ✅ ARM32 (piwheels)
378+
- ✅ ARM64 (Python native support)
379+
- ✅ Any arch where Python runs (noarch package)
380+
381+
View the full platform matrix in the updated README.
382+
EOF

0 commit comments

Comments
 (0)