Skip to main content
Glama
publish.yaml1.81 kB
name: Publish to PyPI on: release: types: [published] workflow_dispatch: # Allow manual triggering jobs: publish: runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/m4-mcp permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing contents: read steps: - uses: actions/checkout@v4 - name: Set up uv uses: astral-sh/setup-uv@v5 with: version: "latest" python-version: "3.11" - name: Extract version from tag id: get_version run: | if [[ $GITHUB_REF == refs/tags/* ]]; then VERSION=${GITHUB_REF#refs/tags/} VERSION=${VERSION#v} else # Fallback for non-tag runs (e.g. manual dispatch on main) VERSION="0.0.0.dev0" echo "Warning: Triggered on $GITHUB_REF, not a tag. Using placeholder: $VERSION" fi echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Publishing version: $VERSION" - name: Update version in __init__.py run: | # Update version in src/m4/__init__.py to match the git tag sed -i "s|__version__ = \".*\"|__version__ = \"${{ steps.get_version.outputs.version }}\"|" src/m4/__init__.py echo "Updated src/m4/__init__.py version to ${{ steps.get_version.outputs.version }}" grep "__version__" src/m4/__init__.py - name: Sync dependencies including dev run: uv sync --all-groups - name: Run quick tests run: | uv run pytest tests/ -v --tb=short - name: Build package run: uv build - name: Verify package run: uv run --with twine twine check dist/* - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: print-hash: true

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hannesill/m4'

If you have feedback or need assistance with the MCP directory API, please join our Discord server