Skip to content

Commit 5e0fe98

Browse files
ci: harden distribution smoke workflow
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 34bc449 commit 5e0fe98

2 files changed

Lines changed: 58 additions & 10 deletions

File tree

.github/workflows/smoke-distribution.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
permissions:
1616
contents: read
1717

18+
env:
19+
PACKAGE_NAME: create-awesome-python-app
20+
DOCKER_IMAGE: ulisesjeremias/create-awesome-python-app
21+
1822
concurrency:
1923
group: smoke-distribution
2024
cancel-in-progress: true
@@ -28,27 +32,38 @@ jobs:
2832
- name: Smoke uvx
2933
run: |
3034
set -euo pipefail
31-
uvx create-awesome-python-app@latest --version
32-
uvx create-awesome-python-app@latest --help | head -5
35+
VERSION="$(uvx "$PACKAGE_NAME@latest" --version 2>&1)"
36+
echo "uvx version: $VERSION"
37+
echo "$VERSION" | grep -qE '[0-9]+\.[0-9]+\.[0-9]+' || {
38+
echo "::error::Unexpected uvx version output: $VERSION"
39+
exit 1
40+
}
41+
42+
uvx "$PACKAGE_NAME@latest" --help > /tmp/cpa-help.txt
43+
test -s /tmp/cpa-help.txt
44+
python3 -c "from pathlib import Path; print('\n'.join(Path('/tmp/cpa-help.txt').read_text().splitlines()[:5]))"
3345
3446
docker:
3547
name: Docker Hub
3648
runs-on: ubuntu-latest
3749
steps:
3850
- name: Pull image
39-
run: docker pull ulisesjeremias/create-awesome-python-app:latest
51+
run: docker pull "$DOCKER_IMAGE:latest"
4052

4153
- name: Verify --version
4254
run: |
4355
VERSION=$(docker run --rm ulisesjeremias/create-awesome-python-app:latest --version 2>&1)
4456
echo "docker version: $VERSION"
45-
echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' || {
57+
echo "$VERSION" | grep -qE '[0-9]+\.[0-9]+\.[0-9]+' || {
4658
echo "::error::Unexpected version output: $VERSION"
4759
exit 1
4860
}
4961
5062
- name: Verify --help
51-
run: docker run --rm ulisesjeremias/create-awesome-python-app:latest --help | head -5
63+
run: |
64+
docker run --rm "$DOCKER_IMAGE:latest" --help > /tmp/cpa-help.txt
65+
test -s /tmp/cpa-help.txt
66+
python3 -c "from pathlib import Path; print('\n'.join(Path('/tmp/cpa-help.txt').read_text().splitlines()[:5]))"
5267
5368
homebrew:
5469
name: Homebrew (Create-Python-App/tap)
@@ -64,13 +79,16 @@ jobs:
6479
run: |
6580
VERSION=$(create-awesome-python-app --version 2>&1)
6681
echo "homebrew version: $VERSION"
67-
echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' || {
82+
echo "$VERSION" | grep -qE '[0-9]+\.[0-9]+\.[0-9]+' || {
6883
echo "::error::Unexpected version output: $VERSION"
6984
exit 1
7085
}
7186
7287
- name: Verify --help
73-
run: create-awesome-python-app --help | head -5
88+
run: |
89+
create-awesome-python-app --help > /tmp/cpa-help.txt
90+
test -s /tmp/cpa-help.txt
91+
python3 -c "from pathlib import Path; print('\n'.join(Path('/tmp/cpa-help.txt').read_text().splitlines()[:5]))"
7492
7593
aur:
7694
name: AUR (archlinux container)
@@ -105,11 +123,13 @@ jobs:
105123
su builder -c "
106124
VERSION=\$(create-awesome-python-app --version 2>&1)
107125
echo \"aur version: \$VERSION\"
108-
echo \"\$VERSION\" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+\$' || exit 1
126+
echo \"\$VERSION\" | grep -qE '[0-9]+\.[0-9]+\.[0-9]+' || exit 1
109127
"
110128
111129
- name: Verify --help
112-
run: su builder -c "create-awesome-python-app --help | head -5"
130+
run: |
131+
su builder -c "create-awesome-python-app --help > /tmp/cpa-help.txt && test -s /tmp/cpa-help.txt"
132+
python3 -c "from pathlib import Path; print('\n'.join(Path('/tmp/cpa-help.txt').read_text().splitlines()[:5]))"
113133
114134
versions:
115135
name: Cross-check published versions
@@ -127,7 +147,9 @@ jobs:
127147
)
128148
129149
DOCKER=$(
130-
docker run --rm ulisesjeremias/create-awesome-python-app:latest --version 2>&1 \
150+
docker run --rm "$DOCKER_IMAGE:latest" --version 2>&1 \
151+
| grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
152+
| head -1 \
131153
|| echo "unavailable"
132154
)
133155
@@ -152,6 +174,17 @@ jobs:
152174
echo " homebrew: $HOMEBREW"
153175
echo " aur: $AUR"
154176
177+
{
178+
echo "## Distribution smoke versions"
179+
echo
180+
echo "| Channel | Version |"
181+
echo "|---------|---------|"
182+
echo "| PyPI | $PYPI |"
183+
echo "| Docker | $DOCKER |"
184+
echo "| Homebrew | $HOMEBREW |"
185+
echo "| AUR | $AUR |"
186+
} >> "$GITHUB_STEP_SUMMARY"
187+
155188
for CHANNEL_VER in "$DOCKER" "$HOMEBREW"; do
156189
if [ "$CHANNEL_VER" != "unavailable" ] && [ "$CHANNEL_VER" != "$PYPI" ]; then
157190
echo "::warning::Version mismatch vs pypi=$PYPI: $CHANNEL_VER"

docs/DISTRIBUTION_SETUP.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ brew install create-awesome-python-app && create-awesome-python-app --version
127127
yay -S create-awesome-python-app && create-awesome-python-app --version
128128
```
129129

130+
## Scheduled distribution smoke
131+
132+
`Distribution smoke tests` runs daily and can also be dispatched manually:
133+
134+
```bash
135+
gh workflow run "Distribution smoke tests" --repo Create-Python-App/create-python-app
136+
gh run list --workflow smoke-distribution.yml --repo Create-Python-App/create-python-app --limit 5
137+
```
138+
139+
Before closing distribution issues, link a green run that covers all published
140+
channels: PyPI via `uvx`, Docker Hub, Homebrew, AUR, and the cross-channel
141+
version summary. Channel version mismatches are warnings when a downstream
142+
package can legitimately lag PyPI, but install/help/version failures must stay
143+
red.
144+
130145
## After secrets are in place
131146

132147
Every subsequent release only requires tagging `create-awesome-python-app@X.Y.Z`.

0 commit comments

Comments
 (0)