Make a separate codebase for the client #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Agent Memory Client CI | |
on: | |
push: | |
branches: [main] | |
tags: | |
- 'client/v*.*.*' | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: Test (Python ${{ matrix.python-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
working-directory: agent-memory-client | |
run: uv sync --extra dev | |
- name: Lint with Ruff | |
working-directory: agent-memory-client | |
run: uv run ruff check agent_memory_client | |
- name: Check formatting with Ruff formatter | |
working-directory: agent-memory-client | |
run: uv run ruff format --check agent_memory_client | |
- name: Type check with mypy | |
working-directory: agent-memory-client | |
run: uv run mypy agent_memory_client | |
- name: Run tests | |
working-directory: agent-memory-client | |
run: uv run pytest tests/ --cov=agent_memory_client --cov-report=xml | |
publish-testpypi: | |
name: Publish to TestPyPI | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/client/') && contains(github.ref, '-') | |
runs-on: ubuntu-latest | |
environment: testpypi | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install build tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build package | |
working-directory: agent-memory-client | |
run: python -m build | |
- name: Publish package to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
packages-dir: agent-memory-client/dist/ | |
publish-pypi: | |
name: Publish to PyPI | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/client/') && !contains(github.ref, '-') | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install build tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build package | |
working-directory: agent-memory-client | |
run: python -m build | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: agent-memory-client/dist/ | |
# Alternative: API Token Authentication (if trusted publishing doesn't work) | |
# Uncomment the sections below and add these secrets to your repository: | |
# - TEST_PYPI_API_TOKEN (for TestPyPI) | |
# - PYPI_API_TOKEN (for PyPI) | |
# | |
# For TestPyPI job, replace the publish step with: | |
# - name: Publish package to TestPyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# repository-url: https://test.pypi.org/legacy/ | |
# packages-dir: agent-memory-client/dist/ | |
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
# | |
# For PyPI job, replace the publish step with: | |
# - name: Publish package to PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# packages-dir: agent-memory-client/dist/ | |
# password: ${{ secrets.PYPI_API_TOKEN }} |