Skip to content

Remove examples/, DEMO.md, duplicate publish workflow #89

Remove examples/, DEMO.md, duplicate publish workflow

Remove examples/, DEMO.md, duplicate publish workflow #89

Workflow file for this run

name: CI
on:
push:
branches:
- main
- feat/**
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
- name: Run tests
run: python -m pytest -q -m "not integration"
publish:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment: pypi
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build
run: |
python -m pip install --upgrade pip build
python -m build
- name: Check if version exists on PyPI
id: check
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
if pip index versions agentbreak 2>/dev/null | grep -q "$VERSION"; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish to PyPI
if: steps.check.outputs.exists == 'false'
uses: pypa/gh-action-pypi-publish@release/v1