blob: 03eb3cbe61138b94b3e4ad85e057e1391a1c579a [file] [log] [blame]
Max031ac912017-08-25 14:22:18 +02001ifndef REL
2 REL := patch
Maxff932bb2017-07-04 18:19:38 +02003endif
4
Max031ac912017-08-25 14:22:18 +02005NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }')
6LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS)
7MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am)
8ISODATE := $(shell date -I)
9
Maxff932bb2017-07-04 18:19:38 +020010release:
Max031ac912017-08-25 14:22:18 +020011
12ifeq ($(NEW_VER),)
13 @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.)
Maxff932bb2017-07-04 18:19:38 +020014endif
Max031ac912017-08-25 14:22:18 +020015
16ifeq ($(origin REL), file)
17 @echo "No REL value specified, defaulting to 'patch' release"
18endif
19
20 @echo "Releasing" $(VERSION) "->" $(NEW_VER)"..."
21
Maxff932bb2017-07-04 18:19:38 +020022ifeq ($(LIBVERS),)
Maxd5962a82017-08-24 13:24:04 +020023 @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch
Maxff932bb2017-07-04 18:19:38 +020024else
25 @echo "You should NOT be doing this unless you've read and understood following article:"
26 @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info"
Max031ac912017-08-25 14:22:18 +020027 @grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries
Maxff932bb2017-07-04 18:19:38 +020028 @grep '#' TODO-RELEASE > TODO-RELEASE.clean
29 @mv TODO-RELEASE.clean TODO-RELEASE
Max031ac912017-08-25 14:22:18 +020030ifeq ($(MAKEMOD),)
31 @$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS)))
Maxff932bb2017-07-04 18:19:38 +020032endif
Max031ac912017-08-25 14:22:18 +020033 @xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry"
34endif
35 @dch -r -m --distribution "unstable" ""
Maxff932bb2017-07-04 18:19:38 +020036 @git add -u
Max031ac912017-08-25 14:22:18 +020037 @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VER) --allow-dirty
38 @git tag -s $(NEW_VER) -f -m "Release v$(NEW_VER) on $(ISODATE)."
39 @echo "Release" $(NEW_VER) "prepared, tagged and signed."