|
| 1 | +# How to Make a Release |
| 2 | +# --------------------- |
| 3 | +# |
| 4 | +# This file answers the question "how to make a release" hopefully |
| 5 | +# better than a document does (only meejah and warner may currently do |
| 6 | +# the "upload to PyPI" part anyway) |
| 7 | +# |
| 8 | + |
| 9 | +default: |
| 10 | + echo "see Makefile" |
| 11 | + echo "Make a new tag, then 'make release'" |
| 12 | + echo "git tag |
| 13 | + |
| 14 | +release: |
| 15 | + @echo "Is checkout clean?" |
| 16 | + git diff-files --quiet |
| 17 | + git diff-index --quiet --cached HEAD -- |
| 18 | + |
| 19 | + @echo "Install required build software" |
| 20 | + python3 -m pip install docutils |
| 21 | + |
| 22 | + @echo "Test README" |
| 23 | + python3 setup.py check -s |
| 24 | + |
| 25 | + @echo "Is GPG Agent running, and has key?" |
| 26 | + gpg --pinentry=loopback -u [email protected] --armor --clear-sign NEWS |
| 27 | + |
| 28 | + @echo "Build and sign wheel" |
| 29 | + python3 setup.py bdist_wheel |
| 30 | + gpg --pinentry=loopback -u [email protected] --armor --detach-sign dist/spake2-`git describe --abbrev=0 | tail -c +2`-py3-none-any.whl |
| 31 | + ls dist/*`git describe --abbrev=0 | tail -c +2`* |
| 32 | + |
| 33 | + @echo "Build and sign source-dist" |
| 34 | + python3 setup.py sdist |
| 35 | + gpg --pinentry=loopback -u [email protected] --armor --detach-sign dist/spake2-`git describe --abbrev=0 | tail -c +2`.tar.gz |
| 36 | + ls dist/*`git describe --abbrev=0 | tail -c +2`* |
| 37 | + |
| 38 | +release-test: |
| 39 | + gpg --verify dist/spake2-`git describe --abbrev=0 | tail -c +2`.tar.gz.asc |
| 40 | + gpg --verify dist/spake2-`git describe --abbrev=0 | tail -c +2`-py3-none-any.whl.asc |
| 41 | + python -m venv test_spake2_venv |
| 42 | + test_spake2_venv/bin/pip install --upgrade pip |
| 43 | + test_spake2_venv/bin/pip install dist/spake2-`git describe --abbrev=0 | tail -c +2`-py3-none-any.whl |
| 44 | + test_spake2_venv/bin/python -c "import spake2" |
| 45 | + test_spake2_venv/bin/pip uninstall -y spake2 |
| 46 | + test_spake2_venv/bin/pip install dist/spake2-`git describe --abbrev=0 | tail -c +2`.tar.gz |
| 47 | + test_spake2_venv/bin/python -c "import spake2" |
| 48 | + rm -rf test_spake2_venv |
| 49 | + |
| 50 | +release-upload: |
| 51 | + twine upload --username __token__ --password `cat PRIVATE-release-token` dist/spake2-`git describe --abbrev=0 | tail -c +2`-py3-none-any.whl dist/spake2-`git describe --abbrev=0 | tail -c +2`-py3-none-any.whl.asc dist/spake2-`git describe --abbrev=0 | tail -c +2`.tar.gz dist/spake2-`git describe --abbrev=0 | tail -c +2`.tar.gz.asc |
| 52 | + mv dist/*-`git describe --abbrev=0 | tail -c +2`.tar.gz.asc signatures/ |
| 53 | + mv dist/*-`git describe --abbrev=0 | tail -c +2`-py3-none-any.whl.asc signatures/ |
| 54 | + git push origin-push `git describe --abbrev=0 | tail -c +2` |
0 commit comments