-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpiwheels-arm32-verification.yml
More file actions
217 lines (180 loc) · 8.81 KB
/
Copy pathpiwheels-arm32-verification.yml
File metadata and controls
217 lines (180 loc) · 8.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# .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)
[](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