Skip to content

Commit 8bfd16b

Browse files
authored
Update piwheels-arm32-verification.yml
Signed-off-by: 1minds3t <1minds3t@proton.me>
1 parent 9959fa2 commit 8bfd16b

1 file changed

Lines changed: 114 additions & 53 deletions

File tree

.github/workflows/piwheels-arm32-verification.yml

Lines changed: 114 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22
name: ARM32 Support Verification (piwheels)
33

44
on:
5-
# Run 24 hours after a release is published (gives piwheels time to build)
65
release:
76
types: [published]
8-
# Also allow manual trigger
97
workflow_dispatch:
108
inputs:
119
version:
1210
description: 'Version to check (e.g., 2.0.3)'
1311
required: false
1412
default: 'latest'
15-
# Check daily at 3 AM UTC
1613
schedule:
17-
- cron: '0 3 * * *'
14+
- cron: '0 3 * * *' # Daily at 3 AM UTC
1815

1916
jobs:
2017
verify-piwheels:
@@ -34,7 +31,6 @@ jobs:
3431
if: github.event_name == 'release'
3532
run: |
3633
echo "⏳ Waiting 24 hours for piwheels to build ARM32 wheels..."
37-
echo "Release published at: ${{ github.event.release.published_at }}"
3834
sleep 86400 # 24 hours
3935
4036
- name: Get latest version
@@ -44,26 +40,25 @@ jobs:
4440
VERSION="${{ github.event.inputs.version }}"
4541
elif [ "${{ github.event_name }}" == "release" ]; then
4642
VERSION="${{ github.event.release.tag_name }}"
47-
VERSION="${VERSION#v}" # Remove 'v' prefix if present
43+
VERSION="${VERSION#v}"
4844
else
49-
# Get latest from PyPI
5045
VERSION=$(curl -s https://pypi.org/pypi/omnipkg/json | python3 -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
5146
fi
5247
5348
echo "version=$VERSION" >> $GITHUB_OUTPUT
5449
echo "Checking version: $VERSION"
5550
56-
- name: Check piwheels builds
57-
id: check
51+
- name: Scrape piwheels data
52+
id: scrape
5853
run: |
5954
VERSION="${{ steps.version.outputs.version }}"
6055
61-
echo "🔍 Checking piwheels for omnipkg $VERSION..."
56+
echo "🔍 Scraping piwheels for omnipkg $VERSION..."
6257
63-
# Fetch piwheels project page
58+
# Fetch the project page
6459
RESPONSE=$(curl -s "https://www.piwheels.org/project/omnipkg/")
6560
66-
# Check if this version exists on piwheels
61+
# Check if version exists
6762
if ! echo "$RESPONSE" | grep -q "$VERSION"; then
6863
echo "❌ Version $VERSION not found on piwheels yet"
6964
echo "builds_found=false" >> $GITHUB_OUTPUT
@@ -72,79 +67,145 @@ jobs:
7267
7368
echo "✅ Version $VERSION found on piwheels"
7469
75-
# Check for wheel file
76-
WHEEL_URL="https://www.piwheels.org/simple/omnipkg/omnipkg-${VERSION}-py3-none-any.whl"
70+
# Extract wheel filename (should be omnipkg-X.X.X-py3-none-any.whl)
71+
WHEEL_FILE=$(echo "$RESPONSE" | grep -oP "omnipkg-${VERSION}-py3-none-any\.whl" | head -1)
7772
78-
if curl --output /dev/null --silent --head --fail "$WHEEL_URL"; then
73+
if [ -n "$WHEEL_FILE" ]; then
74+
WHEEL_URL="https://www.piwheels.org/simple/omnipkg/${WHEEL_FILE}"
7975
echo "✅ ARM32 wheel found: $WHEEL_URL"
8076
echo "builds_found=true" >> $GITHUB_OUTPUT
8177
echo "wheel_url=$WHEEL_URL" >> $GITHUB_OUTPUT
78+
echo "wheel_file=$WHEEL_FILE" >> $GITHUB_OUTPUT
8279
83-
# Extract supported Python versions from the page
84-
# piwheels shows: Bullseye Python 3.9, Bookworm Python 3.11, Trixie Python 3.13
85-
if echo "$RESPONSE" | grep -q "Bullseye Python 3.9"; then
86-
echo "python_versions=3.9, 3.11, 3.13" >> $GITHUB_OUTPUT
80+
# Extract supported Python versions from the releases table
81+
PYTHON_VERSIONS=""
82+
83+
# Check for Bullseye (Python 3.9)
84+
if echo "$RESPONSE" | grep -A 10 "$VERSION" | grep -q "Bullseye Python 3.9"; then
85+
PYTHON_VERSIONS="${PYTHON_VERSIONS}3.9, "
86+
fi
87+
88+
# Check for Bookworm (Python 3.11)
89+
if echo "$RESPONSE" | grep -A 10 "$VERSION" | grep -q "Bookworm Python 3.11"; then
90+
PYTHON_VERSIONS="${PYTHON_VERSIONS}3.11, "
91+
fi
92+
93+
# Check for Trixie (Python 3.13)
94+
if echo "$RESPONSE" | grep -A 10 "$VERSION" | grep -q "Trixie Python 3.13"; then
95+
PYTHON_VERSIONS="${PYTHON_VERSIONS}3.13, "
8796
fi
97+
98+
# Remove trailing comma and space
99+
PYTHON_VERSIONS=$(echo "$PYTHON_VERSIONS" | sed 's/, $//')
100+
101+
echo "python_versions=$PYTHON_VERSIONS" >> $GITHUB_OUTPUT
102+
echo "🐍 Python versions: $PYTHON_VERSIONS"
103+
104+
# Extract install command
105+
INSTALL_CMD="pip3 install omnipkg==${VERSION}"
106+
echo "install_command=$INSTALL_CMD" >> $GITHUB_OUTPUT
88107
else
89108
echo "❌ ARM32 wheel not found for version $VERSION"
90109
echo "builds_found=false" >> $GITHUB_OUTPUT
91110
fi
92111
93-
- name: Update README with ARM32 badge
94-
if: steps.check.outputs.builds_found == 'true'
112+
- name: Update README badges section
113+
if: steps.scrape.outputs.builds_found == 'true'
95114
run: |
96115
VERSION="${{ steps.version.outputs.version }}"
97-
PYTHON_VERS="${{ steps.check.outputs.python_versions }}"
116+
PYTHON_VERS="${{ steps.scrape.outputs.python_versions }}"
117+
INSTALL_CMD="${{ steps.scrape.outputs.install_command }}"
118+
WHEEL_URL="${{ steps.scrape.outputs.wheel_url }}"
119+
120+
# Create the auto-update block for README
121+
cat > .github/piwheels-stats.md << EOF
122+
<!-- PIWHEELS_STATS_START -->
123+
## 🥧 ARM32 Support (Raspberry Pi)
124+
125+
[![piwheels](https://img.shields.io/badge/piwheels-ARM32%20verified-97BF0D?logo=raspberrypi&logoColor=white)](https://www.piwheels.org/project/omnipkg/)
126+
127+
**Latest Version:** \`${VERSION}\` | **Python:** ${PYTHON_VERS} | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
128+
129+
\`\`\`bash
130+
# Install on Raspberry Pi (ARM32)
131+
${INSTALL_CMD}
132+
\`\`\`
133+
134+
**Verified Platforms:**
135+
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye (Debian 11), Bookworm (Debian 12), Trixie (Debian 13)
136+
- 📦 Wheel: [\`${WHEEL_URL}\`](${WHEEL_URL})
137+
138+
<!-- PIWHEELS_STATS_END -->
139+
EOF
98140

99-
# Create a badge for ARM32 support
100-
cat > piwheels-arm32.json << EOF
141+
# Update README.md if the markers exist
142+
if grep -q "<!-- PIWHEELS_STATS_START -->" README.md; then
143+
# Use perl for cross-platform in-place editing
144+
perl -i -p0e 's/<!-- PIWHEELS_STATS_START -->.*?<!-- PIWHEELS_STATS_END -->//gs' README.md
145+
146+
# Insert new content after installation section
147+
sed -i '/#### 🥧 piwheels (for Raspberry Pi)/r .github/piwheels-stats.md' README.md
148+
fi
149+
150+
- name: Generate platform support matrix
151+
if: steps.scrape.outputs.builds_found == 'true'
152+
run: |
153+
# This will be used to build the comprehensive platform table
154+
cat > .github/platform-matrix.json << EOF
101155
{
102-
"schemaVersion": 1,
103-
"label": "ARM32 (armv6/v7)",
104-
"message": "verified on piwheels",
105-
"color": "success"
156+
"arm32": {
157+
"verified": true,
158+
"version": "${{ steps.version.outputs.version }}",
159+
"python_versions": "${{ steps.scrape.outputs.python_versions }}",
160+
"install_command": "${{ steps.scrape.outputs.install_command }}",
161+
"platforms": ["Raspberry Pi", "Raspbian Bullseye", "Raspbian Bookworm", "Raspbian Trixie"]
162+
}
106163
}
107164
EOF
108165
109-
echo "✅ ARM32 (armv6/v7) support verified for version $VERSION"
110-
echo "📦 Wheel: ${{ steps.check.outputs.wheel_url }}"
111-
echo "🐍 Python versions: $PYTHON_VERS"
166+
echo "✅ Platform matrix generated"
167+
168+
- name: Commit changes
169+
if: steps.scrape.outputs.builds_found == 'true'
170+
run: |
171+
git config user.name "github-actions[bot]"
172+
git config user.email "github-actions[bot]@users.noreply.github.com"
173+
174+
git add README.md .github/piwheels-stats.md .github/platform-matrix.json || true
175+
176+
if ! git diff --staged --quiet; then
177+
git commit -m "Auto-update piwheels ARM32 stats for v${{ steps.version.outputs.version }} [skip ci]"
178+
git pull --rebase origin main
179+
git push
180+
else
181+
echo "No changes to commit"
182+
fi
112183
113184
- name: Create verification summary
114-
if: steps.check.outputs.builds_found == 'true'
185+
if: steps.scrape.outputs.builds_found == 'true'
115186
run: |
116187
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
117188
## ✅ ARM32 Support Verified
118189
119190
**Version:** `${{ steps.version.outputs.version }}`
120191
121-
**Platform:** ARM32 (armv6/armv7) - Raspberry Pi compatible
192+
**Architecture:** ARM32 (armv6/armv7) - Raspberry Pi compatible
122193
123-
**Python Versions:** ${{ steps.check.outputs.python_versions }}
194+
**Python Versions:** ${{ steps.scrape.outputs.python_versions }}
124195
125-
**Wheel URL:** [${{ steps.check.outputs.wheel_url }}](${{ steps.check.outputs.wheel_url }})
196+
**Install Command:**
197+
```bash
198+
${{ steps.scrape.outputs.install_command }}
199+
```
200+
201+
**Wheel URL:** [${{ steps.scrape.outputs.wheel_file }}](${{ steps.scrape.outputs.wheel_url }})
126202
127203
**Verified on:**
128-
- Bullseye (Debian 11) - Python 3.9
129-
- Bookworm (Debian 12) - Python 3.11
130-
- Trixie (Debian 13) - Python 3.13
204+
- 🍓 Bullseye (Debian 11) - Python 3.9
205+
- 🍓 Bookworm (Debian 12) - Python 3.11
206+
- 🍓 Trixie (Debian 13) - Python 3.13
131207
132208
---
133209
134210
This wheel is built and tested by [piwheels.org](https://www.piwheels.org/project/omnipkg/) on real Raspberry Pi hardware.
135211
EOF
136-
137-
- name: Commit badge (if changed)
138-
if: steps.check.outputs.builds_found == 'true'
139-
run: |
140-
git config user.name "github-actions[bot]"
141-
git config user.email "github-actions[bot]@users.noreply.github.com"
142-
143-
if [ -f piwheels-arm32.json ]; then
144-
git add piwheels-arm32.json
145-
git diff --staged --quiet || {
146-
git commit -m "Verify ARM32 support on piwheels [skip ci]"
147-
git pull --rebase origin main
148-
git push
149-
}
150-
fi

0 commit comments

Comments
 (0)