From 5f73673a55872ba272e16c370f7e4d3830c6b87e Mon Sep 17 00:00:00 2001 From: Noah Pendleton <2538614+noahp@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:12:51 -0400 Subject: [PATCH] Tweak release script to support token auth --- README.rst | 11 ++++++++--- release.sh | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 2ff641d..9f44eee 100644 --- a/README.rst +++ b/README.rst @@ -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 @@ -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/* @@ -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="" TWINE_USERNAME=__token__ ./release.sh Contributing ============ diff --git a/release.sh b/release.sh index 43956ab..b8928b6 100755 --- a/release.sh +++ b/release.sh @@ -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"