Publish to PyPI #9
Workflow file for this run
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: Publish to PyPI | |
on: | |
release: | |
types: [published] | |
branches: [main] # Only trigger for releases from main | |
env: | |
UV_VERSION: "0.6.0" # Pin uv version to avoid breaking changes | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://test.pypi.org/project/supabase-mcp-server/ # TODO: Change to pypi.org after testing | |
permissions: | |
id-token: write # Required for trusted publishing | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required for proper version detection | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: ${{ env.UV_VERSION }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Build package | |
run: uv build --no-sources | |
- name: Verify package installation and entry points | |
env: | |
SUPABASE_PROJECT_REF: ${{ secrets.SUPABASE_PROJECT_REF }} | |
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }} | |
run: | | |
# Create a new venv for testing | |
uv venv | |
source .venv/bin/activate | |
# Install the built wheel | |
uv pip install dist/*.whl | |
echo "Testing supabase-mcp-server entry point..." | |
# Run with --help to test basic functionality without needing actual connection | |
if ! uv run supabase-mcp-server --help; then | |
echo "❌ supabase-mcp-server --help failed" | |
exit 1 | |
fi | |
echo "✅ supabase-mcp-server --help succeeded" | |
echo "Testing supabase-mcp-inspector entry point..." | |
if ! uv run supabase-mcp-inspector --help; then | |
echo "❌ supabase-mcp-inspector --help failed" | |
exit 1 | |
fi | |
echo "✅ supabase-mcp-inspector --help succeeded" | |
# Test actual connection if credentials are available | |
echo "Testing supabase-mcp-inspector startup..." | |
# Run inspector in background and capture PID | |
timeout 5s uv run supabase-mcp-inspector & | |
INSPECTOR_PID=$! | |
# Wait briefly for it to start | |
sleep 2 | |
# Check if process is still running (success) or failed to start | |
if ps -p $INSPECTOR_PID > /dev/null; then | |
echo "✅ supabase-mcp-inspector started successfully" | |
kill $INSPECTOR_PID | |
else | |
echo "❌ supabase-mcp-inspector failed to start" | |
exit 1 | |
fi | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ # TODO: Change to pypi.org after testing |