Files
qmk/util/travis_compiled_push.sh
T

64 lines
1.6 KiB
Bash
Raw Normal View History

#!/bin/bash
2019-11-05 00:18:57 +00:00
source util/travis_utils.sh
source util/travis_push.sh
2018-03-29 14:47:02 -07:00
set -o errexit -o nounset
rev=$(git rev-parse --short HEAD)
2018-12-25 16:40:53 -08:00
echo "Using git hash ${rev}"
2018-03-29 14:47:02 -07:00
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
2017-08-21 23:39:06 -04:00
git checkout master
2017-07-02 23:38:20 -04:00
git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE}
2017-02-06 16:42:18 -05:00
if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
2017-11-14 22:14:59 -05:00
make generate-keyboards-file SILENT=true > .keyboards
2017-02-06 16:42:18 -05:00
cd ..
2017-05-28 16:16:56 -04:00
git clone git@github.com:qmk/qmk.fm.git
2017-02-06 16:42:18 -05:00
cd qmk.fm
2017-08-21 21:57:46 -04:00
mv ../qmk_firmware/id_rsa_qmk.fm id_rsa_qmk.fm
2017-11-14 22:14:59 -05:00
mv ../qmk_firmware/.keyboards .
ssh-add -D
eval `ssh-agent -s`
2017-08-21 21:57:46 -04:00
ssh-add id_rsa_qmk.fm
2018-12-25 16:40:53 -08:00
2017-11-17 14:09:27 -05:00
# don't delete files in case not all keyboards are built
# rm -f compiled/*.hex
2017-08-23 15:44:17 -04:00
# ignore errors here
2019-05-28 20:38:47 +02:00
# In theory, this is more flexible, and will allow for additional expansion of additional types of files and other names
mv ../qmk_firmware/*_default.*{hex,bin} ./compiled/ || true
# get the list of keyboards
readarray -t keyboards < .keyboards
# replace / with _
keyboards=("${keyboards[@]//[\/]/_}")
# remove all binaries that don't belong to a keyboard in .keyboards
for file in "./compiled"/* ; do
match=0
for keyboard in "${keyboards[@]}" ; do
if [[ ${file##*/} = "${keyboard}_default.bin" ]] || [[ ${file##*/} = "${keyboard}_default.hex" ]]; then
match=1
break
fi
done
if [[ $match = 0 ]]; then
echo "Removing deprecated binary: $file"
rm "$file"
fi
done
2017-11-14 22:31:34 -05:00
bash _util/generate_keyboard_page.sh
2017-02-06 16:42:18 -05:00
git add -A
2018-12-25 16:40:53 -08:00
git commit -m "generated from qmk/qmk_firmware@${rev}"
2017-05-29 12:49:25 -04:00
git push git@github.com:qmk/qmk.fm.git
2018-03-29 14:47:02 -07:00
fi
2017-02-06 16:56:39 -05:00
fi