Skip to content

Commit daf2557

Browse files
committed
Use gh to manage releases
1 parent 3636d58 commit daf2557

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

common.mk

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -37,11 +32,8 @@ release:
3732
git commit -m ${TAG}; \
3833
git tag --sign --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

0 commit comments

Comments
 (0)