Skip to content

ARM32 Support Verification (piwheels) #81

ARM32 Support Verification (piwheels)

ARM32 Support Verification (piwheels) #81

# .github/workflows/piwheels-arm32-verification.yml
name: ARM32 Support Verification (piwheels)
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to check (e.g., 2.0.3)'
required: false
default: 'latest'
schedule:
- cron: '0 3 * * *' # Daily at 3 AM UTC
jobs:
verify-piwheels:
name: Verify ARM32 on piwheels
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Wait for piwheels (if triggered by release)
if: github.event_name == 'release'
run: |
echo "⏳ Waiting 24 hours for piwheels to build ARM32 wheels..."
sleep 86400 # 24 hours
- name: Get latest version
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ github.event.inputs.version }}" != "latest" ]; then
VERSION="${{ github.event.inputs.version }}"
elif [ "${{ github.event_name }}" == "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
VERSION="${VERSION#v}"
else
VERSION=$(curl -s https://pypi.org/pypi/omnipkg/json | python3 -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Checking version: $VERSION"
- name: Scrape piwheels data
id: scrape
run: |
VERSION="${{ steps.version.outputs.version }}"
echo "🔍 Scraping piwheels for omnipkg $VERSION..."
# Fetch the project page
RESPONSE=$(curl -s "https://www.piwheels.org/project/omnipkg/")
# Check if version exists
if ! echo "$RESPONSE" | grep -q "$VERSION"; then
echo "❌ Version $VERSION not found on piwheels yet"
echo "builds_found=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "✅ Version $VERSION found on piwheels"
# Extract wheel filename (should be omnipkg-X.X.X-py3-none-any.whl)
WHEEL_FILE=$(echo "$RESPONSE" | grep -oP "omnipkg-${VERSION}-py3-none-any\.whl" | head -1)
if [ -n "$WHEEL_FILE" ]; then
WHEEL_URL="https://www.piwheels.org/simple/omnipkg/${WHEEL_FILE}"
echo "✅ ARM32 wheel found: $WHEEL_URL"
echo "builds_found=true" >> $GITHUB_OUTPUT
echo "wheel_url=$WHEEL_URL" >> $GITHUB_OUTPUT
echo "wheel_file=$WHEEL_FILE" >> $GITHUB_OUTPUT
# Extract supported Python versions from the releases table
PYTHON_VERSIONS=""
# Check for Bullseye (Python 3.9)
if echo "$RESPONSE" | grep -A 10 "$VERSION" | grep -q "Bullseye Python 3.9"; then
PYTHON_VERSIONS="${PYTHON_VERSIONS}3.9, "
fi
# Check for Bookworm (Python 3.11)
if echo "$RESPONSE" | grep -A 10 "$VERSION" | grep -q "Bookworm Python 3.11"; then
PYTHON_VERSIONS="${PYTHON_VERSIONS}3.11, "
fi
# Check for Trixie (Python 3.13)
if echo "$RESPONSE" | grep -A 10 "$VERSION" | grep -q "Trixie Python 3.13"; then
PYTHON_VERSIONS="${PYTHON_VERSIONS}3.13, "
fi
# Remove trailing comma and space
PYTHON_VERSIONS=$(echo "$PYTHON_VERSIONS" | sed 's/, $//')
echo "python_versions=$PYTHON_VERSIONS" >> $GITHUB_OUTPUT
echo "🐍 Python versions: $PYTHON_VERSIONS"
# Extract install command
INSTALL_CMD="pip3 install omnipkg==${VERSION}"
echo "install_command=$INSTALL_CMD" >> $GITHUB_OUTPUT
else
echo "❌ ARM32 wheel not found for version $VERSION"
echo "builds_found=false" >> $GITHUB_OUTPUT
fi
- name: Update README badges section
if: steps.scrape.outputs.builds_found == 'true'
run: |
VERSION="${{ steps.version.outputs.version }}"
PYTHON_VERS="${{ steps.scrape.outputs.python_versions }}"
INSTALL_CMD="${{ steps.scrape.outputs.install_command }}"
WHEEL_URL="${{ steps.scrape.outputs.wheel_url }}"
# Create the auto-update block for README
cat > .github/piwheels-stats.md <<'PIWHEELS_BLOCK'
<!-- PIWHEELS_STATS_START -->
## 🥧 ARM32 Support (Raspberry Pi)
[![piwheels](https://img.shields.io/badge/piwheels-ARM32%20verified-97BF0D?logo=raspberrypi&logoColor=white)](https://www.piwheels.org/project/omnipkg/)
**Latest Version:** `VERSION_PLACEHOLDER` | **Python:** PYTHON_VERS_PLACEHOLDER | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
```bash
# Install on Raspberry Pi (ARM32)
INSTALL_CMD_PLACEHOLDER
```
**Verified Platforms:**
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye (Debian 11), Bookworm (Debian 12), Trixie (Debian 13)
- 📦 Wheel: [`WHEEL_URL_PLACEHOLDER`](WHEEL_URL_PLACEHOLDER)
<!-- PIWHEELS_STATS_END -->
PIWHEELS_BLOCK
# Replace placeholders
sed -i "s|VERSION_PLACEHOLDER|${VERSION}|g" .github/piwheels-stats.md
sed -i "s|PYTHON_VERS_PLACEHOLDER|${PYTHON_VERS}|g" .github/piwheels-stats.md
sed -i "s|INSTALL_CMD_PLACEHOLDER|${INSTALL_CMD}|g" .github/piwheels-stats.md
sed -i "s|WHEEL_URL_PLACEHOLDER|${WHEEL_URL}|g" .github/piwheels-stats.md
# Update README.md if the markers exist
if grep -q "<!-- PIWHEELS_STATS_START -->" README.md; then
# Use perl for cross-platform in-place editing
perl -i -p0e 's/<!-- PIWHEELS_STATS_START -->.*?<!-- PIWHEELS_STATS_END -->//gs' README.md
# Insert new content after installation section
sed -i '/#### 🥧 piwheels (for Raspberry Pi)/r .github/piwheels-stats.md' README.md
fi
- name: Generate platform support matrix
if: steps.scrape.outputs.builds_found == 'true'
run: |
# This will be used to build the comprehensive platform table
cat > .github/platform-matrix.json <<MATRIX_JSON
{
"arm32": {
"verified": true,
"version": "${{ steps.version.outputs.version }}",
"python_versions": "${{ steps.scrape.outputs.python_versions }}",
"install_command": "${{ steps.scrape.outputs.install_command }}",
"platforms": ["Raspberry Pi", "Raspbian Bullseye", "Raspbian Bookworm", "Raspbian Trixie"]
}
}
MATRIX_JSON
echo "✅ Platform matrix generated"
- name: Commit changes
if: steps.scrape.outputs.builds_found == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.md .github/piwheels-stats.md .github/platform-matrix.json || true
if ! git diff --staged --quiet; then
git commit -m "Auto-update piwheels ARM32 stats for v${{ steps.version.outputs.version }} [skip ci]"
git pull --rebase origin main
git push
else
echo "No changes to commit"
fi
- name: Create verification summary
if: steps.scrape.outputs.builds_found == 'true'
run: |
{
echo "## ✅ ARM32 Support Verified"
echo ""
echo "**Version:** \`${{ steps.version.outputs.version }}\`"
echo ""
echo "**Architecture:** ARM32 (armv6/armv7) - Raspberry Pi compatible"
echo ""
echo "**Python Versions:** ${{ steps.scrape.outputs.python_versions }}"
echo ""
echo "**Install Command:**"
echo "\`\`\`bash"
echo "${{ steps.scrape.outputs.install_command }}"
echo "\`\`\`"
echo ""
echo "**Wheel URL:** [${{ steps.scrape.outputs.wheel_file }}](${{ steps.scrape.outputs.wheel_url }})"
echo ""
echo "**Verified on:**"
echo "- 🍓 Bullseye (Debian 11) - Python 3.9"
echo "- 🍓 Bookworm (Debian 12) - Python 3.11"
echo "- 🍓 Trixie (Debian 13) - Python 3.13"
echo ""
echo "---"
echo ""
echo "This wheel is built and tested by [piwheels.org](https://www.piwheels.org/project/omnipkg/) on real Raspberry Pi hardware."
} >> $GITHUB_STEP_SUMMARY