blob: 4407c861d33a709211bed70c8c5f973366342106 [file] [log] [blame]
Maxff932bb2017-07-04 18:19:38 +02001ifdef REL
2NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }')
3LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS)
4ISODATE := $(shell date -I)
5endif
6
7release:
8ifeq ($(NEW_VERSION),)
9 @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release)
10endif
11 @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..."
12ifeq ($(LIBVERS),)
13 @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge
14else
15 @echo "You should NOT be doing this unless you've read and understood following article:"
16 @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info"
17 @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry"
18 @dch -r -m --distribution "unstable" ""
19 @grep '#' TODO-RELEASE > TODO-RELEASE.clean
20 @mv TODO-RELEASE.clean TODO-RELEASE
21 @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!"
22 @echo "Are you sure the following versions are correct?"
23 @echo $(LIBVERS)
24endif
25 @git add -u
26 @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty
27 @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)."
28 @echo "Release" $(NEW_VERSION) "prepared, tagged and signed."