The LNMP Python SDK has two main GitHub Actions workflows for continuous integration and release automation.
Triggers:
- Push to
mainordevelopbranches - Pull requests to
main - Manual workflow dispatch
Jobs:
- Runs
cargo fmt,cargo clippy, and Rust unit tests - Ensures code quality before proceeding
- Matrix strategy across Python 3.9-3.12
- Multi-platform: Linux, macOS, Windows
- Runs pytest with coverage reporting
- Uploads coverage to Codecov
- Triggered via
workflow_dispatch - Builds native wheels for:
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- Uploads wheels as artifacts
- Triggered via
workflow_dispatch - Downloads all platform wheels
- Publishes to PyPI using trusted publisher (OIDC)
- Runs on pushes to
mainonly - Executes performance benchmarks
- Uploads results as artifacts
Triggers:
- Push tags matching
v*(e.g.,v0.5.7)
Jobs:
- Matrix testing across Python 3.9-3.12 and all platforms
- Ensures quality before release
- Builds wheels for all supported platforms:
- Linux x86_64
- macOS universal2 (x86_64 + arm64)
- Windows x86_64
- Uploads as artifacts
- Creates source distribution (sdist)
- Uploads as artifact
- Downloads all wheels and sdist
- Publishes to PyPI using trusted publisher
- Only runs for version tags (not pre-releases)
- Creates GitHub release with changelog
- Attaches all wheels and sdist
- Marks pre-releases appropriately
Both workflows use:
CARGO_TERM_COLOR=always- Colored Cargo outputRUST_BACKTRACE=1- Full backtraces on errorsPYTHONPATH=$PWD:$PYTHONPATH- For local package imports
Configure at https://pypi.org/manage/account/publishing/
Settings:
- Owner: Your GitHub username or organization
- Repository:
lnmp-sdk-python - Workflow:
release.yml - Environment:
pypi
No manual tokens required with trusted publishers!
If trusted publisher isn't available:
- Generate PyPI API token at https://pypi.org/manage/account/token/
- Add as GitHub secret:
PYPI_TOKEN - Update workflow to use token-based authentication
# 1. Update version in pyproject.toml and Cargo.toml
# 2. Commit changes
git add pyproject.toml Cargo.toml
git commit -m "chore: bump version to 0.5.7"
# 3. Create and push tag
git tag v0.5.7
git push origin main
git push origin v0.5.7
# 4. GitHub Actions automatically:
# - Runs tests
# - Builds wheels for all platforms
# - Publishes to PyPI
# - Creates GitHub Release# Use pre-release tag format
git tag v0.5.7-beta.1
git push origin v0.5.7-beta.1
# Workflow will create GitHub release but skip PyPI- None required if using PyPI trusted publisher
PYPI_TOKEN- Only if using manual token authentication
Workflows require:
contents: write- For creating GitHub releasesid-token: write- For PyPI trusted publishing