release.sh 1021 B

12345678910111213141516171819202122232425262728293031
  1. #! /bin/bash
  2. set -euxo pipefail
  3. # update branches
  4. git checkout experimental
  5. git pull
  6. git checkout master
  7. git pull
  8. # merge
  9. git checkout master
  10. git merge -m "Merge experimental branch into master branch" experimental
  11. git push
  12. # add release tag/branch
  13. git checkout master
  14. VERSION=`grep <configure.ac "AC_INIT" | perl -p -e "s/.*AC_INIT\(//" | awk -F ',' '{print $2}'`
  15. DATE=`date +"%Y%m%d%H%M%S"`
  16. RELEASE=${VERSION}-release-${DATE}
  17. git checkout -b ${RELEASE}-branch master
  18. PATH=/software/hpag/autotools/bin:${PATH} autoreconf -i -f
  19. ADDFILES="INSTALL Makefile.in aclocal.m4 autom4te.cache compile config.guess config.h.in config.sub configure depcomp install-sh ltmain.sh m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 missing src/Makefile.in test/Makefile.in"
  20. mv .gitignore .gitignore_
  21. git add ${ADDFILES}
  22. git commit -m "Release ${RELEASE}"
  23. mv .gitignore_ .gitignore
  24. git tag ${RELEASE}
  25. git push origin ${RELEASE}
  26. git checkout master
  27. git branch -D ${RELEASE}-branch
  28. git checkout experimental