@@ -71,14 +71,18 @@ jobs:
7171 name : dist
7272 path : dist/
7373
74+ - uses : actions/setup-python@v5
75+ with :
76+ python-version : " 3.13"
77+
7478 - name : Create GitHub Release
7579 env :
7680 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7781 GH_REPO : ${{ github.repository }}
7882 run : gh release create ${{ github.ref_name }} dist/* --generate-notes
7983
8084 - name : Install twine
81- run : pip install twine
85+ run : pip install --upgrade pip twine
8286
8387 - name : Publish to PyPI
8488 env :
9195 TWINE_USERNAME : ${{ github.repository_owner }}
9296 TWINE_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
9397 run : twine upload --repository-url https://pypi.pkg.github.com/${{ github.repository_owner }} dist/*
98+
99+ smoke-test :
100+ name : Smoke test published package
101+ needs : [publish]
102+ runs-on : ubuntu-latest
103+ steps :
104+ - uses : actions/setup-python@v5
105+ with :
106+ python-version : " 3.13"
107+
108+ - name : Wait for PyPI availability
109+ run : |
110+ VERSION=${GITHUB_REF_NAME#v}
111+ echo "Waiting for serpapi==$VERSION on PyPI..."
112+ for i in $(seq 1 12); do
113+ if pip index versions serpapi 2>/dev/null | grep -q "$VERSION"; then
114+ echo "Available!"
115+ exit 0
116+ fi
117+ echo "Attempt $i/12 — sleeping 10s..."
118+ sleep 10
119+ done
120+ echo "Timed out waiting for PyPI propagation" && exit 1
121+
122+ - name : Install from PyPI
123+ run : |
124+ VERSION=${GITHUB_REF_NAME#v}
125+ pip install "serpapi==$VERSION"
126+
127+ - name : Verify import and version
128+ run : |
129+ VERSION=${GITHUB_REF_NAME#v}
130+ python - <<PY
131+ import serpapi
132+ assert serpapi.__version__ == '$VERSION', f'Version mismatch : {serpapi.__version__} != $VERSION'
133+ print(f'OK : serpapi=={serpapi.__version__} installed successfully')
134+ PY
0 commit comments