diff --git a/.docker_env.list b/.docker_env.list index 291bd70..f79b976 100644 --- a/.docker_env.list +++ b/.docker_env.list @@ -1,2 +1,3 @@ TRACE TEST_OUTPUT_DIR=/app/tmp/test_output +INSIDE_DOCKER=true diff --git a/README.md b/README.md index 9491ecd..d2425a7 100644 --- a/README.md +++ b/README.md @@ -75,11 +75,9 @@ The generated client needed a few fixes 7. Commit "Release version vX.Y.Z" 8. Push to GitHub 9. Tag version: `git tag 'vX.Y.Z' && git push --tags` -10. Clean out any old packages `rm dist/*` -11. Build packages `python setup.py sdist bdist_wheel` -12. Upload packages `twine upload dist/*` -13. Verify package release at https://pypi.python.org/pypi/docraptor -14. Update documentation on docraptor.com +10. `script/release` +11. Verify package release at https://pypi.python.org/pypi/docraptor +12. Update documentation on docraptor.com ## Version Policy diff --git a/script/release b/script/release new file mode 100755 index 0000000..16b02ac --- /dev/null +++ b/script/release @@ -0,0 +1,29 @@ +#!/bin/bash +set -e +[[ "$TRACE" == "true" ]] && set -x +cd "$(dirname "$0")/.." + +if [[ "$INSIDE_DOCKER" != "true" ]]; then + exec script/docker "/app/script/$(basename "$0")" +fi + +echo "Clearing old packages..." +[ -d dist ] && rm dist/* +echo "Old packaged cleared." +echo + +echo "Building packages..." +# TODO: /usr/local/lib/python3.12/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. +python setup.py sdist bdist_wheel +echo "Packages built." +echo + +echo "Installing twine to allow publishing..." +pip install --upgrade twine +echo "Twine installed." +echo + +echo "Publishing packages to pypi..." +twine upload dist/* +echo "Packages published." +echo