Skip to main content
Glama
publish.yml4.46 kB
name: Build and Publish on: push: tags: - "v*" release: types: [published] workflow_dispatch: inputs: version: description: "Version to publish (without v prefix)" required: true type: string jobs: pre-publish-validation: name: Run Tests runs-on: ubuntu-latest strategy: matrix: python-version: ["3.12", "3.13"] steps: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v3 with: version: "latest" enable-cache: true cache-dependency-glob: "uv.lock" - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} - name: Install dependencies run: | uv sync --extra dev - name: Run linting run: | uv run ruff check extractor/ uv run ruff format --check extractor/ - name: Run type checking run: | uv run mypy extractor/ - name: Run tests run: | uv run pytest --cov=extractor --cov-report=xml --cov-report=term-missing - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: file: ./coverage.xml flags: unittests name: codecov-umbrella fail_ci_if_error: false distribution-package-build: name: Build Distribution runs-on: ubuntu-latest needs: pre-publish-validation steps: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v3 with: version: "latest" - name: Set up Python run: uv python install 3.12 - name: Install dependencies run: uv sync - name: Build package run: uv build - name: Check distribution run: | uv pip install twine uv run twine check dist/* - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: dist path: dist/ testpypi-publication: name: Publish to TestPyPI runs-on: ubuntu-latest needs: distribution-package-build if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) environment: name: testpypi url: https://test.pypi.org/p/mcp-data-extractor permissions: id-token: write steps: - name: Download build artifacts uses: actions/download-artifact@v4 with: name: dist path: dist/ - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ verbose: true skip-existing: true pypi-production-publication: name: Publish to PyPI runs-on: ubuntu-latest needs: [distribution-package-build, testpypi-publication] if: github.event_name == 'release' && github.event.action == 'published' environment: name: pypi url: https://pypi.org/p/mcp-data-extractor permissions: id-token: write steps: - name: Download build artifacts uses: actions/download-artifact@v4 with: name: dist path: dist/ - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: verbose: true changelog-update: name: Update Changelog runs-on: ubuntu-latest needs: pypi-production-publication if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Update changelog run: | echo "## Released $(date +'%Y-%m-%d')" >> temp_changelog.md echo "" >> temp_changelog.md echo "Published to PyPI: https://pypi.org/project/mcp-data-extractor/${{ github.ref_name }}/" >> temp_changelog.md echo "" >> temp_changelog.md cat CHANGELOG.md >> temp_changelog.md mv temp_changelog.md CHANGELOG.md - name: Commit changelog update run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add CHANGELOG.md git commit -m "docs: update changelog after ${{ github.ref_name }} release" || exit 0 git push || exit 0

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/ThreeFish-AI/scrapy-mcp'

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