Espruino/scripts/ci_upload.sh
2025-01-29 20:51:13 +01:00

27 lines
620 B
Bash
Executable File

#/bin/bash
# Attempts to upload built binaries to espruino.com
cd `dirname $0`/..
# GITHUB_SHA / TRAVIS_COMMIT
COMMIT=$GITHUB_SHA
# GITHUB_REF_NAME / TRAVIS_BRANCH
BRANCH=$GITHUB_REF_NAME
if [ -z "$COMMIT" ]
then
echo "NO GITHUB_SHA - not uploading"
exit
fi
# we don't care if BRANCH is set or not
if [ -z "$UPLOADTOKEN" ]
then
echo "NO UPLOADTOKEN - not uploading"
exit
fi
if [[ -n \"$UPLOADTOKEN\" ]]; then
cd bin
ls -d *.bin *.hex *.uf2 *.tgz *.zip 2> /dev/null | xargs -I {} curl -v -F "binary=@{}" "https://www.espruino.com/travis_upload.php?commit=$COMMIT&branch=$BRANCH&token=$UPLOADTOKEN";
fi