MCP Pytest Server
by kieranlal
- .github
- workflows
name: Publish to PyPI
on:
push:
branches:
- main
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.check_version.outputs.version_changed }}
new_version: ${{ steps.check_version.outputs.new_version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check if version changed
id: check_version
run: |
git diff HEAD^ HEAD -- pyproject.toml | grep -q "version = " || exit 0
NEW_VERSION=$(grep "version = " pyproject.toml | cut -d'"' -f2)
echo "version_changed=true" >> $GITHUB_OUTPUT
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
build-and-publish:
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/meilisearch-mcp
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true