Skip to content

add publish.yml

add publish.yml #1

Workflow file for this run

name: Publish
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
run: |
python -m pip install --upgrade pip
pip install uv
- name: Install dev/test dependencies
run: |
pip install -e ".[dev]"
pip install -e ".[test]"
- name: Run tests
run: |
uv run pytest
- name: Run ruff
run: |
uv run ruff check .
- name: Run black
run: |
uv run black . --check
- name: Run isort
run: |
uv run isort . --check-only
- name: Run mypy
run: |
uv run mypy mcp_shell_server tests
publish:
needs: test
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
run: |
python -m pip install --upgrade pip
pip install uv
- name: Build package
run: |
uv build
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
uv publish --token $PYPI_TOKEN