|
| 1 | +# SQLAlchemy-Utils Release Process |
| 2 | + |
| 3 | +This document outlines the process for creating a new release of SQLAlchemy-Utils. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Access to the GitHub repository with push permissions |
| 8 | +- PyPI account with API token for the project |
| 9 | +- `uv` package manager installed |
| 10 | +- `gh` CLI tool installed (optional, for GitHub releases) |
| 11 | + |
| 12 | +## Release Process |
| 13 | + |
| 14 | +### 1. Prepare the Release |
| 15 | + |
| 16 | +1. **Update CHANGES.rst** |
| 17 | + - Move items from "Unreleased changes" section to a new version section |
| 18 | + - Follow the existing format: `X.Y.Z (YYYY-MM-DD)` |
| 19 | + - Add a new "Unreleased changes" section |
| 20 | + |
| 21 | +2. **Update version in pyproject.toml** |
| 22 | + ```bash |
| 23 | + # Edit pyproject.toml and update the version field |
| 24 | + version = "X.Y.Z" |
| 25 | + ``` |
| 26 | + |
| 27 | +3. **Commit the changes** |
| 28 | + ```bash |
| 29 | + git add CHANGES.rst pyproject.toml |
| 30 | + git commit -m "Bump version to X.Y.Z" |
| 31 | + git push origin master |
| 32 | + ``` |
| 33 | + |
| 34 | +### 2. Create Git Tag |
| 35 | + |
| 36 | +```bash |
| 37 | +git tag -a X.Y.Z -m "Release version X.Y.Z" |
| 38 | +git push origin X.Y.Z |
| 39 | +``` |
| 40 | + |
| 41 | +### 3. Build and Publish to PyPI |
| 42 | + |
| 43 | +1. **Build the package** |
| 44 | + ```bash |
| 45 | + uv build |
| 46 | + ``` |
| 47 | + |
| 48 | +2. **Publish to PyPI** |
| 49 | + ```bash |
| 50 | + uv publish --token pypi-your-api-token-here |
| 51 | + ``` |
| 52 | + |
| 53 | + Alternatively, set the token as an environment variable: |
| 54 | + ```bash |
| 55 | + export UV_PUBLISH_TOKEN="pypi-your-api-token-here" |
| 56 | + uv publish |
| 57 | + ``` |
| 58 | + |
| 59 | +### 4. Create GitHub Release |
| 60 | + |
| 61 | +```bash |
| 62 | +gh release create X.Y.Z --title "X.Y.Z" --notes-from-tag |
| 63 | +``` |
| 64 | + |
| 65 | +Or create the release manually on GitHub using the tag. |
| 66 | + |
| 67 | +## Version Numbering |
| 68 | + |
| 69 | +This project follows [Semantic Versioning](https://semver.org/): |
| 70 | +- **MAJOR** version for incompatible API changes |
| 71 | +- **MINOR** version for backwards-compatible functionality additions |
| 72 | +- **PATCH** version for backwards-compatible bug fixes |
0 commit comments