-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
28 lines (22 loc) · 829 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
VERSION=$(shell python3 -c "import complex_colormap; print(complex_colormap.__version__)")
default:
@echo "\"make publish\"?"
README.rst: README.md
cat README.md | sed -e 's_<img src="\([^"]*\)" width="\([^"]*\)">_![](\1){width="\2"}_g' -e 's_<p[^>]*>__g' -e 's_</p>__g' > /tmp/README.md
pandoc /tmp/README.md -o README.rst
python3 setup.py check -r -s || exit 1
tag:
# Make sure we're on the master branch
@if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]; then exit 1; fi
@echo "Tagging v$(VERSION)..."
git tag v$(VERSION)
git push --tags
upload: setup.py README.rst
@if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]; then exit 1; fi
rm -f dist/*
python3 setup.py bdist_wheel --universal
gpg --detach-sign -a dist/*
twine upload dist/*
publish: tag upload
clean:
rm -f README.rst