~~~~~~~~~~~~~~~~
- First release ("Hi daddy!", as my soul would tag it)
-*- mode: makefile-gmake; coding: utf-8 -*-
:Project: pglast — Release targets
:Created: gio 03 ago 2017 14:53:18 CEST
:Author: Lele Gaifax <lelemetapensiero.it>
:License: GNU General Public License version 3 or later
:Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Lele Gaifax
BUMPER := $(VENVDIR)/bin/bump-my-version bump
VERSION = $(shell bump-my-version show current_version 2>/dev/null)
MOD_INIT := pglast/__init__.py
DOCS_CONF := docs/conf.py
TWINE := $(VENVDIR)/bin/twine
help::
printf "\nRelease management\n"
printf "==================\n\n"
.PHONY: assert-clean-tree
assert-clean-tree:
(test -z "$(shell git status -s --untracked=no)" || \
(echo "UNCOMMITTED STUFF" && false))
bump-version: $(VENVDIR)/extension.timestamp enums keywords printers-doc
$(BUMPER) $(VERSION_PART)
echo ">>>"
echo ">>> Do your duties (update CHANGES.rst for example), then"
echo ">>> execute “make $(RELEASE_KIND)tag-release”."
echo ">>>"
help::
printf "release\n\tBump version number\n"
.PHONY: release
release: VERSION_PART = minor
release: bump-version
help::
printf "dev-release\n\tBump the development version number\n"
.PHONY: dev-release
dev-release: VERSION_PART = pre_number
dev-release: RELEASE_KIND = dev-
dev-release: bump-version
help::
printf "tag-release\n\tComplete the release tagging the working tree\n"
.PHONY: tag-release
tag-release: check-release-date check-long-description-markup
git commit -a -m "Release $(VERSION)"
git tag -a -m "Version $(VERSION)" v$(VERSION)
help::
printf "dev-tag-release\n\tComplete the development release tagging the working tree\n"
.PHONY: dev-tag-release
dev-tag-release: check-release-date check-long-description-markup
git commit -a -m "Development release $(VERSION)"
git tag -a -m "Development version $(VERSION)" v$(VERSION)
.PHONY: check-long-description-markup
check-long-description-markup:
$(PYTHON) setup.py --quiet sdist
$(TWINE) check dist/pglast-$(VERSION).tar.gz
.PHONY: check-release-date
check-release-date:
fgrep -q "$(VERSION) ($(shell date --iso-8601))" CHANGES.rst \
|| (echo "ERROR: release date of version $(VERSION) not set in CHANGES.rst"; exit 1)
help::
printf "pypi-upload\n\tUpload the source distribution to PyPI\n"
.PHONY: pypi-upload
pypi-upload: assert-clean-tree
$(PYTHON) setup.py sdist
$(TWINE) upload dist/pglast-$(VERSION).tar.gz
help::
printf "publish\n\tUpload to PyPI, push changes and tags to the remote repo\n"
.PHONY: publish
publish: pypi-upload
git push --follow-tags