esp32_ethernet_milight_hub/.prepare_release

32 lines
570 B
Text
Raw Normal View History

2021-01-15 21:49:01 +00:00
#!/bin/bash
set -eo pipefail
prepare_log() {
echo "[prepare release] -- $@"
}
if [ -z "$(git tag -l --points-at HEAD)" ]; then
prepare_log "Skipping non-tagged commit."
exit 0
fi
VERSION=$(git describe)
prepare_log "Preparing release for tagged version: $VERSION"
mkdir -p dist
if [ -d .pio/build ]; then
firmware_prefix=".pio/build"
else
firmware_prefix=".pioenvs"
fi
for file in $(ls ${firmware_prefix}/**/firmware.bin); do
env_dir=$(dirname "$file")
env=$(basename "$env_dir")
cp "$file" "dist/esp8266_milight_hub_${env}-${VERSION}.bin"
done