What time is it ! #369
Workflow file for this run
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: Run pre-commit | |
| run: | | |
| uv run pre-commit run --all-files | |
| - 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, '-test') | |
| 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, '-test') | |
| 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/ | |
| # Tag Format Guide: | |
| # - For TestPyPI (testing): client/v1.0.0-test | |
| # - For PyPI (production): client/v1.0.0 | |
| # | |
| # Use the script: python scripts/tag_and_push_client.py --test (for TestPyPI) | |
| # python scripts/tag_and_push_client.py (for PyPI) | |
| # | |
| # Alternative: This project uses trusted publishing, but you can use API Token | |
| # Authentication (if trusted publishing doesn't work). | |
| # | |
| # To do so, 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 }} |