Re-raise error from urllib as ScryfallError and fix tests (#157) #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Upload to TestPyPI | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| workflow_dispatch: # Allow manual triggers for testing | |
| jobs: | |
| build-and-upload: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Update version with .devN format | |
| id: version | |
| run: | | |
| python scripts/update_version_for_testpypi.py | |
| VERSION=$(grep -Po '^version\s*=\s*"\K[^"]+' pyproject.toml) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building version: $VERSION" | |
| - name: Build package | |
| run: | | |
| python -m build | |
| echo "Build complete. Package contents:" | |
| ls -lh dist/ | |
| - name: Check package metadata | |
| run: | | |
| twine check dist/* | |
| - name: Upload to TestPyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_UPLOAD_TOKEN }} | |
| TWINE_REPOSITORY: testpypi | |
| run: | | |
| twine upload --verbose dist/* | |
| - name: Display installation instructions | |
| if: success() | |
| run: | | |
| echo "════════════════════════════════════════════════════════════════" | |
| echo "✅ Package uploaded successfully to TestPyPI!" | |
| echo "════════════════════════════════════════════════════════════════" | |
| echo "" | |
| echo "Version: ${{ steps.version.outputs.version }}" | |
| echo "" | |
| echo "Test installation with:" | |
| echo " pip install --index-url https://test.pypi.org/simple/ \\" | |
| echo " --extra-index-url https://pypi.org/simple \\" | |
| echo " scrython==${{ steps.version.outputs.version }}" | |
| echo "" | |
| echo "View on TestPyPI: https://test.pypi.org/project/scrython/" | |
| echo "════════════════════════════════════════════════════════════════" |