Skip to content

Commit

Permalink
add release helper
Browse files Browse the repository at this point in the history
on new releases, simply run `make version` to set new version and tags.
  • Loading branch information
sni committed Feb 17, 2020
1 parent daedd73 commit e4fd765
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,16 @@ rpm: dist

deb:
debuild -i -us -uc -b

version:
[ -e .git ] || { echo "changing versions only works in git clones!"; exit 1; }
[ `git status | grep -cP 'working (directory|tree) clean'` -eq 1 ] || { echo "git project is not clean, cannot tag version"; exit 1; }
OLDVERSION=$(shell grep ^VERSION version.sh | awk -F = '{ print $$2}'); \
NEWVERSION=$$(dialog --stdout --inputbox "New Version:" 0 0 "$$OLDVERSION"); \
if [ -n "$$NEWVERSION" ] && [ "$$NEWVERSION" != "$$OLDVERSION" ]; then \
sed -ri "s/$$OLDVERSION/$$NEWVERSION/" version.sh naemon-livestatus.spec; \
sed -e 's/UNRELEASED/unstable/g' -i debian/changelog; \
DEBFULLNAME="Naemon Development Team" DEBEMAIL="Naemon Development <naemon-dev@monitoring-lists.org>" dch --newversion "$$NEWVERSION" --package "naemon-livestatus" -D "UNRELEASED" --urgency "low" "new upstream release"; \
sed -e 's/unstable/UNRELEASED/g' -i debian/changelog; \
fi

0 comments on commit e4fd765

Please sign in to comment.