From 70864c7177d85208623d92409177923221a3566b Mon Sep 17 00:00:00 2001 From: filipton Date: Sun, 12 Jan 2025 12:11:00 +0100 Subject: [PATCH] chore: update release script --- release.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/release.sh b/release.sh index 41ddac2..f80e072 100755 --- a/release.sh +++ b/release.sh @@ -8,13 +8,13 @@ then exit fi -if ! command -v pio &> /dev/null +if ! command -v cargo &> /dev/null then - echo "'pio' could not be found" + echo "'cargo' could not be found" exit fi -cd $SCRIPT_DIR/firmware +cd $SCRIPT_DIR LAST_FIRMWARE_VERSION=$(gh release list | head -n 1 | cut -f 1) echo "Last firmware version: $LAST_FIRMWARE_VERSION" echo -n "Enter new firmware version: " @@ -23,10 +23,15 @@ while [ -z "$RELEASE_VERSION" ]; do read RELEASE_VERSION done -RELEASE_BUILD="$RELEASE_VERSION" pio run +source ~/export-esp.sh +RELEASE_BUILD="$RELEASE_VERSION" cargo esp32c3 -r +RELEASE_BUILD="$RELEASE_VERSION" cargo esp32 -r + +espflash save-image --chip esp32 ./target/xtensa-esp32-none-elf/release/fkm-firmware "/tmp/fkm-build/esp32_STATION_$(cat ./src/version.rs | grep VERSION | cut -d'"' -f 2).bin" +espflash save-image --chip esp32c3 ./target/riscv32imc-unknown-none-elf/release/fkm-firmware "/tmp/fkm-build/esp32c3_STATION_$(cat ./src/version.rs | grep VERSION | cut -d'"' -f 2).bin" cd $SCRIPT_DIR -VERSION=$(cat ./firmware/src/version.h | grep 'FIRMWARE_VERSION' | cut -d'"' -f 2) +VERSION=$(cat ./src/version.rs | grep 'VERSION' | cut -d'"' -f 2) echo "Version: $VERSION" if gh release list | grep -q "$VERSION" ; then @@ -34,6 +39,7 @@ if gh release list | grep -q "$VERSION" ; then exit fi + BUILD_FILES=$(ls /tmp/fkm-build/*_"$VERSION".bin) if [ -z "$BUILD_FILES" ]; then echo "No build files found"