Skip to content

Commit

Permalink
Tweak release script to support token auth
Browse files Browse the repository at this point in the history
  • Loading branch information
noahp committed Oct 18, 2023
1 parent fa78106 commit 5f73673
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Publishing Release
git tag -a {-m=,}x.y.z
4. Push the commit and tag:

.. code-block:: bash
git push && git push --tags
Expand All @@ -109,7 +109,7 @@ Publishing Release
artifact for uploading: https://github.com/HBehrens/puncover/actions OR Build
the package locally: ``python setup.py sdist bdist_wheel``
6. Upload the package to PyPI:

.. code-block:: bash
twine upload dist/*
Expand All @@ -122,7 +122,12 @@ Publishing Release
Release Script
--------------

See ``release.sh`` for a script that automates the above steps.
See ``release.sh`` for a script that automates the above steps. This example
will work with the PyPi tokens (now required):

.. code-block:: bash
PUNCOVER_VERSION=0.3.5 TWINE_PASSWORD="<pypi token>" TWINE_USERNAME=__token__ ./release.sh
Contributing
============
Expand Down
6 changes: 6 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ if ! command -v twine &> /dev/null; then
exit 1
fi

# confirm that the token is set to TWINE_PASSWORD + TWINE_USERNAME
if [[ -z "${TWINE_PASSWORD:-}" || -z "${TWINE_USERNAME:-}" ]]; then
echo "TWINE_PASSWORD and TWINE_USERNAME must be set"
exit 1
fi

# check if tag already exists
if git rev-parse -q --verify "refs/tags/${PUNCOVER_VERSION}"; then
echo "Tag ${PUNCOVER_VERSION} already exists"
Expand Down

0 comments on commit 5f73673

Please sign in to comment.