Ensure that the main branch passes all tests. Run "tox" in a local checkout and also look at the "Build and test package" GitHub Actions workflow at:
https://github.com/ludwigschwardt/python-gnureadline/actions/workflows/test.yaml
Prepare for release by updating the changelog in NEWS.rst, bumping the version number in setup.py and doing a commit announcing the release to the GitHub repository.
Trigger the "Build wheels" GitHub Actions workflow manually by clicking the "Run workflow" button at:
https://github.com/ludwigschwardt/python-gnureadline/actions/workflows/wheels.yaml
Download the "sdist" and "wheels" artifacts of the "Build wheels" workflow and unzip:
$ mkdir wheelhouse $ unzip sdist.zip -d wheelhouse $ unzip wheels.zip -d wheelhouse
Securely upload artifacts to the test PyPI and check that all is well:
$ export IDENTITY=<identity> $ twine upload -r testpypi wheelhouse/*.tar.gz --sign -i $IDENTITY $ twine upload -r testpypi wheelhouse/*.whl --sign -i $IDENTITY
Now upload artifacts to the real PyPI (release!):
$ twine upload wheelhouse/*.tar.gz --sign -i $IDENTITY $ twine upload wheelhouse/*.whl --sign -i $IDENTITY
Tag the git revision that was released:
$ git tag -s vx.y.z -m 'Released to PyPI as gnureadline x.y.z' -u $IDENTITY $ git push origin vx.y.z