Илья Глазунов 537b783726 Add CI/CD pipeline, logging enhancements, and release management
- Create a GitHub Actions workflow for testing with Python 3.12 and 3.13.
- Update Makefile to include release management commands and pipeline checks.
- Document the CI/CD pipeline structure and usage in PIPELINE.md.
- Add structlog for structured logging and enhance logging utilities.
- Implement release management script for automated versioning and tagging.
- Modify logging configuration to support structured logging and improved formatting.
- Update dependencies in pyproject.toml and poetry.lock to include structlog.
- Enhance access logging in server and middleware to include structured data.
2025-09-03 00:13:21 +03:00

83 lines
1.7 KiB
Markdown

# Automated Release Configuration
## How to use the pipeline
### 1. Linting (executed on every push)
```bash
# Triggers:
- push to any branch
- pull request to any branch
# Checks:
- Black (code formatting)
- isort (import sorting)
- flake8 (linting)
- mypy (type checking)
```
### 2. Tests (executed for dev, master, main)
```bash
# Triggers:
- push to branches: dev, master, main
- pull request to branches: dev, master, main
# Checks:
- pytest on Python 3.12 and 3.13
- coverage reports
```
### 3. Build and release (executed for tags)
```bash
# Triggers:
- push tag matching v*.*.*
- manual dispatch through Gitea interface
# Actions:
- Package build via Poetry
- Draft release creation
- Artifact upload (.whl and .tar.gz)
```
## Release workflow
1. **Release preparation:**
```bash
# Update version in pyproject.toml
poetry version patch # or minor/major
# Commit changes
git add pyproject.toml
git commit -m "bump version to $(poetry version -s)"
```
2. **Tag creation:**
```bash
# Create tag
git tag v$(poetry version -s)
git push origin v$(poetry version -s)
```
3. **Automatic process:**
- Pipeline starts automatically
- Linting and tests execute
- Package builds
- Draft release created
4. **Release finalization:**
- Go to Gitea interface
- Find created draft release
- Edit description according to template
- Publish release
## Environment variables
For correct pipeline operation, ensure:
- `GITHUB_TOKEN` - for release creation
- Repository permissions for release creation
## Customization
- Change Python versions in `test.yaml` if needed
- Add additional checks in `lint.yaml`
- Configure notifications in `pipeline.yaml`