2017-08-25 12:22:18 +00:00
|
|
|
ifndef REL
|
|
|
|
REL := patch
|
|
|
|
endif
|
|
|
|
|
2017-09-04 15:15:13 +00:00
|
|
|
BUMPVER := $(shell bumpversion)
|
2017-08-25 12:22:18 +00:00
|
|
|
NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }')
|
2017-07-04 16:19:38 +00:00
|
|
|
LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS)
|
2017-08-25 12:22:18 +00:00
|
|
|
MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am)
|
2017-07-04 16:19:38 +00:00
|
|
|
ISODATE := $(shell date -I)
|
|
|
|
|
|
|
|
release:
|
2017-08-25 12:22:18 +00:00
|
|
|
|
2017-09-04 15:15:13 +00:00
|
|
|
ifeq ($(BUMPVER),)
|
|
|
|
@$(error Unable to find 'bumpversion' command.)
|
|
|
|
endif
|
|
|
|
|
2017-08-25 12:22:18 +00:00
|
|
|
ifeq ($(NEW_VER),)
|
|
|
|
@$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(origin REL), file)
|
|
|
|
@echo "No REL value specified, defaulting to 'patch' release"
|
2017-07-04 16:19:38 +00:00
|
|
|
endif
|
2017-08-25 12:22:18 +00:00
|
|
|
|
|
|
|
@echo "Releasing" $(VERSION) "->" $(NEW_VER)"..."
|
|
|
|
|
2017-07-04 16:19:38 +00:00
|
|
|
ifeq ($(LIBVERS),)
|
2017-08-24 11:24:04 +00:00
|
|
|
@gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch
|
2017-07-04 16:19:38 +00:00
|
|
|
else
|
|
|
|
@echo "You should NOT be doing this unless you've read and understood following article:"
|
|
|
|
@echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info"
|
2017-08-25 12:22:18 +00:00
|
|
|
@grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries
|
2017-07-04 16:19:38 +00:00
|
|
|
@grep '#' TODO-RELEASE > TODO-RELEASE.clean
|
|
|
|
@mv TODO-RELEASE.clean TODO-RELEASE
|
2017-08-25 12:22:18 +00:00
|
|
|
ifeq ($(MAKEMOD),)
|
|
|
|
@$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS)))
|
2017-07-04 16:19:38 +00:00
|
|
|
endif
|
2017-08-25 12:22:18 +00:00
|
|
|
@xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry"
|
|
|
|
endif
|
|
|
|
@dch -r -m --distribution "unstable" ""
|
2017-07-04 16:19:38 +00:00
|
|
|
@git add -u
|
2017-08-25 12:22:18 +00:00
|
|
|
@bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VER) --allow-dirty
|
|
|
|
@git tag -s $(NEW_VER) -f -m "Release v$(NEW_VER) on $(ISODATE)."
|
|
|
|
@echo "Release" $(NEW_VER) "prepared, tagged and signed."
|