@@ -14,6 +14,10 @@ release_patch:
1414
1515release :
1616 @if [[ -z $$ TAG ]]; then echo " Use release_{major,minor,patch}" ; exit 1; fi
17+ @if ! type -P pandoc; then echo " Please install pandoc" ; exit 1; fi
18+ @if ! type -P sponge; then echo " Please install moreutils" ; exit 1; fi
19+ @if ! type -P http; then echo " Please install httpie" ; exit 1; fi
20+ @if ! type -P twine; then echo " Please install twine" ; exit 1; fi
1721 $(eval REMOTE=$(shell git remote get-url origin | perl -ne '/([^\/\:]+\/.+?) (\.git) ? $$ /; print $$ 1' ))
1822 $(eval GIT_USER=$(shell git config --get user.email) )
1923 $(eval GH_AUTH=$(shell if grep -q '@github.com' ~/.git-credentials; then echo $$(grep '@github.com' ~/.git-credentials | python3 -c 'import sys, urllib.parse as p; print(p.urlparse(sys.stdin.read( ) ) .netloc.split("@") [0])' ); else echo $(GIT_USER); fi))
@@ -32,14 +36,15 @@ release:
3236 git commit -m ${TAG} ; \
3337 git tag --sign --annotate --file $$ TAG_MSG ${TAG}
3438 git push --follow-tags
35- http --auth ${GH_AUTH} ${RELEASES_API} tag_name=${TAG} name=${TAG} \
39+ http --check-status -- auth ${GH_AUTH} ${RELEASES_API} tag_name=${TAG} name=${TAG} \
3640 body=" $$ (git tag --list ${TAG} -n99 | perl -pe 's/^\S+\s*// if $$ . == 1' | sed 's/^\s\s\s\s//')"
3741 $(MAKE ) install
38- http --auth ${GH_AUTH} POST ${UPLOADS_API} /$$(http --auth ${GH_AUTH} ${RELEASES_API}/latest | jq .id ) /assets \
42+ http --check-status -- auth ${GH_AUTH} POST ${UPLOADS_API} /$$(http --auth ${GH_AUTH} ${RELEASES_API}/latest | jq .id ) /assets \
3943 name==$$(basename dist/* .whl) label==" Python Wheel" < dist/* .whl
4044 $(MAKE ) pypi_release
4145
4246pypi_release :
43- python setup.py sdist bdist_wheel upload --sign
47+ python setup.py sdist bdist_wheel
48+ twine upload dist/* .tar.gz dist/* .whl --sign --verbose
4449
4550.PHONY : release
0 commit comments