@@ -17,13 +17,8 @@ release:
17
17
@if [[ -z $$ TAG ]]; then echo " Use release-{major,minor,patch}" ; exit 1; fi
18
18
@if ! type -P pandoc; then echo " Please install pandoc" ; exit 1; fi
19
19
@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
21
21
@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)
27
22
git pull
28
23
git clean -x --force $$(python setup.py --name )
29
24
sed -i -e " s/version=\([\'\" ]\)[0-9]*\.[0-9]*\.[0-9]*/version=\1$$ {TAG:1}/" setup.py
@@ -37,11 +32,8 @@ release:
37
32
git commit -m ${TAG} ; \
38
33
git tag --sign --annotate --file $$ TAG_MSG ${TAG}
39
34
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//')"
42
35
$(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//')"
45
37
$(MAKE ) release-pypi
46
38
$(MAKE ) release-docs
47
39
0 commit comments