This guide explains how to publish a new version of django-rustfs to PyPI using GitHub Releases and the automated CD pipeline.
Before you can publish, you must configure Trusted Publishing on PyPI (one-time setup).
- Go to pypi.org/manage/account/publishing
- Click "Add a new pending publisher"
- Fill in the form:
- PyPI Project Name:
django-rustfs - Owner:
CasualEngineerZombie - Repository name:
django-rustfs - Workflow name:
python-publish.yml - Environment name:
pypi
- PyPI Project Name:
- Click "Add"
This tells PyPI to trust the GitHub Actions workflow running in this repository.
Edit pyproject.toml and bump the version:
[project]
name = "django-rustfs"
version = "0.2.0" # <-- bump thisFollow Semantic Versioning:
MAJOR— breaking changesMINOR— new features, backward compatiblePATCH— bug fixes
Add a section to CHANGELOG.md:
## 0.2.0 (2026-06-04)
### Added
- New feature X
### Fixed
- Bug fix Y
### Changed
- Improvement Zgit add pyproject.toml CHANGELOG.md
git commit -m "Release v0.2.0"
git push origin mainGo to GitHub Actions and make sure:
Python packageworkflow passes on all Python versionsLintworkflow passes
Do NOT create a release if CI is failing.
- Go to your repository on GitHub:
https://github.com/CasualEngineerZombie/django-rustfs - Click "Releases" in the right sidebar (or go to
/releases) - Click "Draft a new release"
- Click "Choose a tag" and type the new version:
v0.2.0 - Click "Create new tag: v0.2.0"
- Set Target:
main(or the commit you want to release) - Set Release title:
v0.2.0 - In the Description box, paste the changelog for this version:
## What's Changed ### Added - New feature X ### Fixed - Bug fix Y
- Leave "Set as a pre-release" unchecked (unless it's alpha/beta)
- Leave "Set as the latest release" checked
- Click "Publish release"
# Create an annotated tag
git tag -a v0.2.0 -m "Release v0.2.0"
# Push the tag to GitHub
git push origin v0.2.0Then go to GitHub Releases and edit the tag to add release notes.
After you click "Publish release", GitHub Actions automatically:
- Triggers the
python-publish.ymlworkflow - Builds the package (
python -m build) - Verifies the distributions (
twine check dist/*) - Uploads artifacts to GitHub
- Publishes to PyPI using trusted publishing
- Go to GitHub Actions
- Watch the "Upload Python Package" workflow run
- It should complete in ~2-3 minutes
Once the workflow completes:
- Go to PyPI
- You should see the new version listed
- The release URL will be:
https://pypi.org/project/django-rustfs/0.2.0/
Users can now install it:
pip install django-rustfs==0.2.0Symptom: Publish step fails with invalid-publisher or similar.
Fix:
- Double-check the PyPI trusted publisher config matches exactly:
- Owner:
CasualEngineerZombie - Repository:
django-rustfs - Workflow:
python-publish.yml - Environment:
pypi
- Owner:
- Make sure you created the release from the correct repository (not a fork)
Symptom: Workflow fails waiting for environment approval.
Fix:
- Go to repository Settings > Environments
- Create an environment named
pypiif it doesn't exist - (Optional) Add protection rules (require review, deployment branches)
Symptom: release-build job fails.
Fix:
- Check that
pyproject.tomlis valid - Make sure
README.mdexists (required for PyPI) - Verify
hatchlingbuild backend works:python -m buildlocally
Symptom: PyPI shows old version or wrong version number.
Fix:
- Make sure you bumped
versioninpyproject.tomlbefore creating the release - The release tag (e.g.,
v0.2.0) should match the package version (0.2.0)
Before every release, verify:
- Version bumped in
pyproject.toml -
CHANGELOG.mdupdated - CI passing on
mainbranch - All tests passing locally:
pytest - Linting clean:
ruff check . - Code formatted:
ruff format . - Types clean:
mypy django_rustfs - PyPI trusted publisher configured (one-time)
- GitHub Release created with tag matching version