Release takopi-matrix to PyPI via git tag
Release a new version of takopi-matrix to PyPI.
Before releasing, verify:
# Run tests
uv run pytest
# Build package
uv build
# Verify version files match
grep "version" pyproject.toml
grep "__version__" src/takopi_matrix/__init__.py
Get commits since the last release tag:
# Find last version tag
git describe --tags --abbrev=0
# Get commits since last tag (or all commits if first release)
git log $(git describe --tags --abbrev=0 2>/dev/null || echo --all)..HEAD --oneline
Create/update CHANGELOG.md with the new version entry:
# changelog
## vX.Y.Z (YYYY-MM-DD)
### changes
- Feature description
### fixes
- Bug fix description
### docs
- Documentation update
Changelog Format:
YYYY-MM-DDchanges, fixes, docs, breakingUpdate version in both files:
pyproject.toml: version = "X.Y.Z"src/takopi_matrix/__init__.py: __version__ = "X.Y.Z"This repo has branch protection - cannot push directly to main.
# Stash any local changes first
git stash
# Create release branch
git checkout -b release/vX.Y.Z
# Commit version files
git add CHANGELOG.md pyproject.toml src/takopi_matrix/__init__.py uv.lock
git commit -m "Release vX.Y.Z"
# Push branch
git push -u origin release/vX.Y.Z
# Create PR
gh pr create --title "Release vX.Y.Z" --body "Release vX.Y.Z"
# Merge with rebase (repo only allows rebase, not merge or squash)
gh pr merge --rebase --delete-branch
Important: Create tag AFTER the PR is merged, on the correct commit.
# Sync local main with merged PR
git checkout main
git fetch origin
git reset --hard origin/main
# Create and push tag (now points to correct commit)
git tag vX.Y.Z
git push origin vX.Y.Z
User: /release-takopi-matrix 0.2.0
Claude: Preparing release v0.2.0...
Pre-flight checks:
ā
Tests: 193/193 passing
ā
Build: wheel + sdist created
š Commits since v0.1.1:
- abc1234 Add room-specific engine routing
- def5678 Fix Pydantic v2 config handling
š Generating changelog entry...
ā
CHANGELOG.md updated
ā
pyproject.toml: 0.1.1 ā 0.2.0
ā
__init__.py: 0.1.1 ā 0.2.0
Creating release branch and PR...
ā
Branch: release/v0.2.0
ā
PR #7 created: https://github.com/Zorro909/takopi-matrix/pull/7
ā
PR merged (rebase)
Tagging release...
ā
Tag v0.2.0 pushed
š Release workflow triggered:
- Actions: https://github.com/Zorro909/takopi-matrix/actions
- PyPI: https://pypi.org/project/takopi-matrix/0.2.0/
| Category | When to Use |
|---|---|
changes |
New features, enhancements, API changes |
fixes |
Bug fixes, error corrections |
docs |
Documentation updates, README changes |
breaking |
Breaking API changes (requires MAJOR bump) |
If something goes wrong:
# Delete remote tag
git push origin --delete vX.Y.Z
# Delete local tag
git tag -d vX.Y.Z
# Revert commit
git revert HEAD
PyPI packages cannot be re-uploaded with the same version. Bump to a new patch version if needed.