travis_compiled_push.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. set -o errexit -o nounset
  3. rev=$(git rev-parse --short HEAD)
  4. git config --global user.name "Travis CI"
  5. git config --global user.email "jack.humb+travis.ci@gmail.com"
  6. increment_version ()
  7. {
  8. declare -a part=( ${1//\./ } )
  9. part[2]=$((part[2] + 1))
  10. new="${part[*]}"
  11. echo -e "${new// /.}"
  12. }
  13. NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | wc -l)
  14. if [[ $NEFM -gt 0 ]] ; then
  15. echo "Essential files modified."
  16. lasttag=$(git tag | grep -Ev '\-' | head -1)
  17. newtag=$(increment_version $lasttag)
  18. git tag $newtag
  19. git push --tags
  20. else
  21. echo "No essential files modified."
  22. fi
  23. make ergodox-ez AUTOGEN=true
  24. find . -name ".build" | xargs rm -rf
  25. cd ..
  26. git clone https://$GH_TOKEN@github.com/jackhumbert/qmk.fm.git
  27. cd qmk.fm
  28. git submodule update --init --recursive
  29. rm -rf keyboard
  30. rm -rf keyboards
  31. cp -r ../qmk_firmware/keyboards .
  32. mkdir keyboards/ergodox_ez/
  33. cp ../qmk_firmware/util/ergodox_ez.html keyboards/ergodox_ez/index.html
  34. cp ../qmk_firmware/readme.md qmk_readme.md
  35. ./generate.sh
  36. git add -A
  37. git commit -m "generated from qmk/qmk_firmware@${rev}"
  38. git push