Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame^] | 1 | ifdef REL |
| 2 | NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') |
| 3 | LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) |
| 4 | ISODATE := $(shell date -I) |
| 5 | endif |
| 6 | |
| 7 | release: |
| 8 | ifeq ($(NEW_VERSION),) |
| 9 | @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) |
| 10 | endif |
| 11 | @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." |
| 12 | ifeq ($(LIBVERS),) |
| 13 | @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge |
| 14 | else |
| 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) |
| 24 | endif |
| 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." |