This document describes how to release a new version of shipthisapi-python to PyPI.
The package is automatically published to PyPI when:
- Code is pushed to the
mainbranch - A tag starting with
vis pushed (e.g.,v3.0.5)
Update the version in both files:
-
ShipthisAPI/__init__.py:__version__ = "X.Y.Z"
-
setup.py:version='X.Y.Z',
git checkout -b release/vX.Y.Z
git add -A
git commit -m "chore: bump version to X.Y.Z"
git push origin release/vX.Y.ZThen create a PR to merge into main.
Once the PR is approved and merged, the GitHub Actions workflow will automatically:
- Build the package
- Publish to PyPI
For better release tracking:
git checkout main
git pull
git tag -a vX.Y.Z -m "Release vX.Y.Z"
git push origin vX.Y.ZFollow Semantic Versioning:
- MAJOR (X.0.0): Breaking API changes
- MINOR (0.X.0): New features, backward compatible
- PATCH (0.0.X): Bug fixes, backward compatible
PyPI doesn't allow re-uploading the same version. If you see this error:
- The version was already published
- Bump to the next version number and try again
The publish workflow only runs on:
- Pushes to
mainbranch - Tags starting with
v
Feature branch pushes will NOT trigger a publish.
If GitHub Actions fails, you can publish manually:
# Install build tools
pip install build twine
# Build
python -m build
# Upload (requires PyPI API token)
twine upload dist/*