This repository uses GitHub Actions for automated testing, version management, and releases.
To enable automatic publishing to PyPI, you need to set up a PyPI API token:
- Go to PyPI Account Settings
- Create a new API token with scope "Entire account" or specific to this project
- In your GitHub repository, go to Settings → Secrets and variables → Actions
- Add a new repository secret named
PYPI_TOKENwith your PyPI token as the value
The GITHUB_TOKEN is automatically provided by GitHub Actions - no setup required.
- Triggers: Push to
main/develop, Pull Requests, Monthly schedule - Purpose: Comprehensive testing across multiple OS and Python versions
- Features:
- Tests on Ubuntu, macOS, Windows
- Python versions: 3.10, 3.11, 3.12, 3.13
- Code coverage reporting
- Linting (Black, isort, flake8, mypy)
- Security scanning (Bandit, Safety)
- Triggers: Push to
main(when version changes), Manual dispatch - Purpose: Automatic release when version is bumped in
pyproject.toml - Features:
- Detects version changes automatically
- Runs full test suite
- Publishes to PyPI
- Creates GitHub release with artifacts
- Requires >80% test coverage
- Triggers: Manual dispatch only
- Purpose: Interactive version bumping with release
- Features:
- Choose bump type: patch/minor/major
- Dry run option for testing
- Updates version in all files
- Creates git tags
- Automatic release after version bump
- Triggers: GitHub release creation, Manual dispatch
- Purpose: Release from existing code without version changes
- Features:
- Works with existing releases
- Full test suite before publishing
- PyPI publishing
- Release asset uploads
- Update version in
pyproject.toml:version = "0.2.4" # Bump from 0.2.3
- Commit and push to
main - Auto-release workflow triggers automatically
- Package is published to PyPI and GitHub release is created
- Go to Actions → "Version Bump and Release"
- Click "Run workflow"
- Choose version bump type (patch/minor/major)
- Optionally enable dry run for testing
- Workflow handles version update and release
- Go to Actions → "Manual Release"
- Click "Run workflow"
- Release is created from current code
You can monitor workflow status in the Actions tab of your repository. Each workflow provides detailed logs and will fail if any step encounters an error.
- PyPI Token Invalid: Check that
PYPI_TOKENsecret is correctly set - Tests Failing: All tests must pass before release
- Coverage Too Low: Minimum 80% coverage required for auto-release
- Version Already Exists: Cannot release same version twice
All workflows enforce these quality standards:
- ✅ All tests must pass
- ✅ Type checking (mypy) must pass
- ✅ Code formatting (Black, isort) must be correct
- ✅ Linting (flake8) must pass
- ✅ Security scans (Bandit, Safety) are run
- ✅ Test coverage ≥80% for releases
graph TD
A[Push to main] --> B{Version changed?}
B -->|Yes| C[Auto Release]
B -->|No| D[CI Tests Only]
E[Manual Version Bump] --> F[Update Version]
F --> G[Create Tag]
G --> H[Trigger Release]
I[Manual Release] --> J[Release Current Code]
C --> K[Publish to PyPI]
H --> K
J --> K
This setup ensures reliable, automated releases while maintaining code quality and security standards.