Skip to content

Commit

Permalink
Improve release process
Browse files Browse the repository at this point in the history
Why is this change needed?
--------------------------
Ideally releasing uses docker to prevent environment issues.

How does it address the issue?
------------------------------
Add `script/release` to allowing scripting the process.

Any links to any relevant tickets, articles, or other resources?
---------------------------------------------------------------
https://3.basecamp.com/3093825/buckets/29124557/todos/5284412189
https://3.basecamp.com/3093825/buckets/29124557/todos/5284421778

Any screenshots?
----------------

Did you complete all of the following?
--------------------------------------
- Run test suite?
- Add new tests?
- Consider security implications and practices?
  • Loading branch information
jason-o-matic committed Nov 16, 2022
1 parent 1e461a8 commit 92acc8d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
1 change: 1 addition & 0 deletions .docker_env.list
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
TRACE
TEST_OUTPUT_DIR=/app/tmp/test_output
INSIDE_DOCKER=true
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions script/release
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 92acc8d

Please sign in to comment.