3 source util
/travis_utils.sh
4 source util
/travis_push.sh
6 set -o errexit
-o nounset
8 rev=$
(git rev-parse
--short HEAD
)
9 echo "Using git hash ${rev}"
11 if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
15 git
diff --diff-filter=AM
--name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} |
xargs -0 dos2unix
16 git
diff --diff-filter=AM
--name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} '*.c' '*.h' '*.cpp' |
grep -z -e '^drivers' -e '^quantum' -e '^tests' -e '^tmk_core' |
grep -zv -e 'quantum/template' -e 'tmk_core/protocol/usb_hid' |
xargs -0 clang-format
-i
17 git
diff --diff-filter=AM
--name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} |
xargs -0 git add
18 git commit
-m "format code according to conventions [skip ci]" && git push git@github.com
:qmk
/qmk_firmware.git master
22 declare -a part
=( ${1//\./ } )
23 part
[2]=$
((part
[2] + 1))
28 git
diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE}
30 NEFM
=$
(git
diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} |
grep -Ev '^(keyboards/)' |
grep -Ev '^(docs/)' |
grep -Ev '^(users/)' |
grep -Ev '^(layouts/)' |
wc -l)
31 if [[ $NEFM -gt 0 ]] ; then
32 echo "Essential files modified."
34 lasttag
=$
(git tag
--sort=-creatordate --no-column --list '*.*.*' |
grep -E -m1 '^[0-9]+\.[0-9]+\.[0-9]+$')
35 newtag
=$
(increment_version
$lasttag)
36 until git tag
$newtag; do
37 newtag
=$
(increment_version
$newtag)
39 git push
--tags git@github.com
:qmk
/qmk_firmware.git
41 echo "No essential files modified."
44 if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
45 make generate-keyboards-file SILENT
=true
> .keyboards
47 git clone git@github.com
:qmk
/qmk.fm.git
49 mv ..
/qmk_firmware
/id_rsa_qmk.fm id_rsa_qmk.fm
50 mv ..
/qmk_firmware
/.keyboards .
55 # don't delete files in case not all keyboards are built
56 # rm -f compiled/*.hex
59 # In theory, this is more flexible, and will allow for additional expansion of additional types of files and other names
60 mv ..
/qmk_firmware
/*_default.
*{hex
,bin
} .
/compiled
/ || true
62 # get the list of keyboards
63 readarray
-t keyboards
< .keyboards
66 keyboards
=("${keyboards[@]//[\/]/_}")
68 # remove all binaries that don't belong to a keyboard in .keyboards
69 for file in "./compiled"/* ; do
71 for keyboard
in "${keyboards[@]}" ; do
72 if [[ ${file##*/} = "${keyboard}_default.bin" ]] || [[ ${file##*/} = "${keyboard}_default.hex
" ]]; then
77 if [[ $match = 0 ]]; then
78 echo "Removing deprecated binary
: $file"
83 bash _util/generate_keyboard_page.sh
85 git commit -m "generated from qmk
/qmk_firmware@
${rev}"
86 git push git@github.com:qmk/qmk.fm.git