This document describes the process for releasing a new version of nmcli.
Currently, only GitHub Release automation is implemented. PyPI publishing automation will be added in the future.
- All tests pass (
python -m pytest tests) - Type checking passes (
python -m mypy nmcli) - Lint checks pass (
python -m pylint nmcli) - README.md Change Log is updated
- README.md API documentation is up to date
- README.md Compatibility table is up to date
Follow semantic versioning:
- MAJOR: Incompatible API changes
- MINOR: Backwards-compatible functionality additions
- PATCH: Backwards-compatible bug fixes
Example: Current 1.6.0 → Next 1.7.0 (for feature additions)
[project]
version = "1.7.0" # ← Update thisAdd the new version's changes to the "Change Log" section in README.md:
### 1.7.0
- Added support for `connection.show_all` with active filtering
- Added support for `device.up` and `device.down` commands
- Added support for `general.reload` with configuration flagsgit add pyproject.toml README.md
git commit -m "Release v1.7.0"# Push to main branch
git push origin main
# Create tag
git tag v1.7.0
# Push tag (this triggers GitHub Actions)
git push origin v1.7.0- Check workflow execution status at https://github.com/ushiboy/nmcli/actions
- Verify all tests pass
- Verify build succeeds
- Go to https://github.com/ushiboy/nmcli/releases
- Open the auto-created draft release
- Edit release notes:
- Review auto-generated content
- Add main changes as bullet points in the "What's Changed" section
- Clean up commit history if needed
- Click "Publish release" to publish
PyPI publishing is currently done manually:
# Build (requires Python 3.10+)
python -m build
# Upload to PyPI
twine upload dist/nmcli-1.7.0*Error: Package version (1.6.0) does not match tag version (1.7.0)
Cause: Forgot to update version in pyproject.toml
Solution:
- Delete tag:
git tag -d v1.7.0 && git push origin :v1.7.0 - Fix pyproject.toml and commit
- Create and push tag again
Solution:
- Delete tag (see above)
- Fix tests and commit
- Create and push tag again
Recommended to verify locally before tagging:
# Clean build verification
rm -rf dist/
python -m build
# Check generated files
ls -lh dist/The following will be added in the future:
-
PyPI Trusted Publishers Setup
- Register GitHub repository as a trusted publisher on PyPI
- No token management needed, more secure
-
Workflow Extension
- Automatically publish to PyPI after GitHub Release
- Or make PyPI publishing optional at draft stage
-
TestPyPI Validation
- Validate on TestPyPI before production release
Before releasing, verify:
- Updated pyproject.toml version
- Updated README.md Change Log
- All tests pass locally
- Committed changes
- Pushed to main
- Created and pushed tag
- Verified GitHub Actions completion
- Edited draft release
- Published release
- (Current) Manually uploaded to PyPI