@@ -17,13 +17,8 @@ release:
1717 @if [[ -z $$ TAG ]]; then echo " Use release-{major,minor,patch}" ; exit 1; fi
1818 @if ! type -P pandoc; then echo " Please install pandoc" ; exit 1; fi
1919 @if ! type -P sponge; then echo " Please install moreutils" ; exit 1; fi
20- @if ! type -P http ; then echo " Please install httpie " ; exit 1; fi
20+ @if ! type -P gh ; then echo " Please install gh " ; exit 1; fi
2121 @if ! type -P twine; then echo " Please install twine" ; exit 1; fi
22- $(eval REMOTE=$(shell git remote get-url origin | perl -ne '/([^\/\:]+\/[^\/\:]+?) (\.git) ? $$ /; print $$ 1' ))
23- $(eval GIT_USER=$(shell git config --get user.email) )
24- $(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))
25- $(eval RELEASES_API=https://api.github.com/repos/${REMOTE}/releases)
26- $(eval UPLOADS_API=https://uploads.github.com/repos/${REMOTE}/releases)
2722 git pull
2823 git clean -x --force $$(python setup.py --name )
2924 sed -i -e " s/version=\([\'\" ]\)[0-9]*\.[0-9]*\.[0-9]*/version=\1$$ {TAG:1}/" setup.py
@@ -35,19 +30,16 @@ release:
3530 if [[ -f Changes.md ]]; then cat $$ TAG_MSG <( echo) Changes.md | sponge Changes.md; git add Changes.md; fi ; \
3631 if [[ -f Changes.rst ]]; then cat <( pandoc --from markdown --to rst $$ TAG_MSG) <( echo) Changes.rst | sponge Changes.rst; git add Changes.rst; fi ; \
3732 git commit -m ${TAG} ; \
38- git tag --sign -- annotate --file $$ TAG_MSG ${TAG}
33+ git tag --annotate --file $$ TAG_MSG ${TAG}
3934 git push --follow-tags
40- http --check-status --auth ${GH_AUTH} ${RELEASES_API} tag_name=${TAG} name=${TAG} \
41- body=" $$ (git tag --list ${TAG} -n99 | perl -pe 's/^\S+\s*// if $$ . == 1' | sed 's/^\s\s\s\s//')"
4235 $(MAKE ) install
43- http --check-status --auth ${GH_AUTH} POST ${UPLOADS_API} /$$(http --auth ${GH_AUTH} ${RELEASES_API}/latest | jq .id ) /assets \
44- name==$$(basename dist/* .whl) label==" Python Wheel" < dist/* .whl
36+ gh release create ${TAG} dist/* .whl --notes=" $$ (git tag --list ${TAG} -n99 | perl -pe 's/^\S+\s*// if $$ . == 1' | sed 's/^\s\s\s\s//')"
4537 $(MAKE ) release-pypi
4638 $(MAKE ) release-docs
4739
4840release-pypi :
4941 python -m build
50- twine upload dist/* .tar.gz dist/* .whl --sign -- verbose
42+ twine upload dist/* .tar.gz dist/* .whl --verbose
5143
5244release-docs :
5345 $(MAKE ) docs
0 commit comments