release.sh 909 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. #git status
  3. if [[ $1 == "" ]] || [[ $2 == "" ]] || [[ $3 == "" ]]; then
  4. echo "Bad version"
  5. exit 1
  6. fi
  7. v="$1.$2.$3"
  8. echo "About to release $v"
  9. read -p "Are you sure you are ready: " N
  10. [ "$N" != "YES" ] && exit
  11. sed -ri "s/MAJOR_VERSION=[0-9]+ MINOR_VERSION=[0-9]+ PATCH_VERSION=[0-9]+/MAJOR_VERSION=$1 MINOR_VERSION=$2 PATCH_VERSION=$3/" wkhtmltopdf.pro
  12. ./scripts/static-build.sh linux || (echo Build failed; exit 1)
  13. if ! ./scripts/test.sh; then
  14. echo "Test failed"
  15. exit 1
  16. fi
  17. ./scripts/static-build.sh win || (echo Build failed; exit 1)
  18. git commit -m "Making ready for version $v" wkhtmltopdf.pro
  19. git tag "$v"
  20. rm -rf release-$v
  21. mkdir release-$v
  22. git checkout-index --prefix=./release-$v/wkhtmltopdf-$v/ -a
  23. tar -cjvf release-$v/wkhtmltopdf-$v.tar.bz2 -C release-$v wkhtmltopdf-$v
  24. cp wkhtmltopdf.exe release-$v/wkhtmltopdf-$v.exe
  25. tar -cjvf release-$v/wkhtmltopdf-$v-static.tar.bz2 wkhtmltopdf