Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 1 | ifndef REL |
| 2 | REL := patch |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 3 | endif |
| 4 | |
Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 5 | NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') |
| 6 | LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) |
| 7 | MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) |
| 8 | ISODATE := $(shell date -I) |
| 9 | |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 10 | release: |
Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 11 | |
| 12 | ifeq ($(NEW_VER),) |
| 13 | @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 14 | endif |
Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 15 | |
| 16 | ifeq ($(origin REL), file) |
| 17 | @echo "No REL value specified, defaulting to 'patch' release" |
| 18 | endif |
| 19 | |
| 20 | @echo "Releasing" $(VERSION) "->" $(NEW_VER)"..." |
| 21 | |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 22 | ifeq ($(LIBVERS),) |
Max | d5962a8 | 2017-08-24 13:24:04 +0200 | [diff] [blame] | 23 | @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 24 | else |
| 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" |
Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 27 | @grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 28 | @grep '#' TODO-RELEASE > TODO-RELEASE.clean |
| 29 | @mv TODO-RELEASE.clean TODO-RELEASE |
Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 30 | ifeq ($(MAKEMOD),) |
| 31 | @$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS))) |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 32 | endif |
Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 33 | @xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry" |
| 34 | endif |
| 35 | @dch -r -m --distribution "unstable" "" |
Max | ff932bb | 2017-07-04 18:19:38 +0200 | [diff] [blame] | 36 | @git add -u |
Max | 031ac91 | 2017-08-25 14:22:18 +0200 | [diff] [blame] | 37 | @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." |