Repository navigation
added --backup command #15
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: Publish & Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| test: | |
| name: Test tagged commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out tagged commit | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Run unit tests | |
| run: pytest tests/ -m "not local and not api_embeddings" -q | |
| publish: | |
| name: Validate, build, publish, and release | |
| runs-on: ubuntu-latest | |
| needs: test | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/groundmemory/ | |
| steps: | |
| - name: Check out tagged commit | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Validate tag matches pyproject version | |
| shell: bash | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| PYPROJECT_VERSION=$(python - <<'PY' | |
| import tomllib | |
| from pathlib import Path | |
| data = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8")) | |
| print(data["project"]["version"]) | |
| PY | |
| ) | |
| echo "Tag version: $TAG_VERSION" | |
| echo "pyproject.toml version: $PYPROJECT_VERSION" | |
| if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then | |
| echo "Error: tag version does not match pyproject.toml version" | |
| exit 1 | |
| fi | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| - name: Build release distributions | |
| run: python -m build | |
| - name: Publish distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: dist/* |