Skip to content

Commit

Permalink
make: shownote
Browse files Browse the repository at this point in the history
  • Loading branch information
markokr committed Jun 9, 2021
1 parent 21d6933 commit d082b5f
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@

VERSION = $(shell python3 setup.py --version)
RXVERSION = $(shell python3 setup.py --version | sed 's/\./[.]/g')
TAG = v$(VERSION)
NEWS = NEWS.rst

all:

clean:
rm -rf build *.egg-info */__pycache__ tests/*.pyc
rm -rf debian/python-* debian/files debian/*.log
rm -rf debian/*.substvars debian/*.debhelper debian/*-stamp
rm -rf .pybuild MANIFEST

xlint:
tox -e xlint

xclean: clean
rm -rf .tox dist

test:
TEST_DB_NAME=testdb TEST_Q_NAME=testq PGHOST=/tmp PGPORT=5120 tox -e py38

VERSION = $(shell python3 setup.py --version)
RXVERSION = $(shell python3 setup.py --version | sed 's/\./[.]/g')
TAG = v$(VERSION)

checkver:
@echo "Checking version"
@grep -qE '^## [-_a-z0-9]+ $(RXVERSION)\b' NEWS.md \
|| { echo "Version '$(VERSION)' not in NEWS.md"; exit 1; }
@head debian/changelog | grep -q '[(]$(RXVERSION)-' debian/changelog \
|| { echo "Version '$(VERSION)' not in debian/changelog"; exit 1; }
@grep -q '^pgq $(RXVERSION)\b' $(NEWS) \
|| { echo "Version '$(VERSION)' not in $(NEWS)"; exit 1; }
@echo "Checking git repo"
@git diff --stat --exit-code || { echo "ERROR: Unclean repo"; exit 1; }

release: checkver
git tag $(TAG)
git push github $(TAG):$(TAG)

TGZ = dist/pgq-$(VERSION).tar.gz
URL = https://github.com/pgq/python-pgq/releases/download/v$(VERSION)/pgq-$(VERSION).tar.gz

upload:
mkdir -p dist && rm -f dist/*
cd dist && wget -q $(URL)
tar tvf $(TGZ)
twine upload dist/*.gz
unrelease:
git push github :$(TAG)
git tag -d $(TAG)

shownote:
awk -v VER="$(VERSION)" -f etc/note.awk $(NEWS) \
| pandoc -f rst -t gfm --wrap=none

0 comments on commit d082b5f

Please sign in to comment.