1
1
#! /bin/bash
2
+ # Disable shellcheck warning about using 'cat' to read a file.
2
3
# shellcheck disable=SC2002
3
4
4
5
# For reference: add tools for all boards by replacing one line in each board
@@ -23,14 +24,27 @@ ESP_ARDUINO_VERSION_MINOR="$2"
23
24
ESP_ARDUINO_VERSION_PATCH=" $3 "
24
25
ESP_ARDUINO_VERSION=" $ESP_ARDUINO_VERSION_MAJOR .$ESP_ARDUINO_VERSION_MINOR .$ESP_ARDUINO_VERSION_PATCH "
25
26
27
+ # Get ESP-IDF version from push.yml (this way we can ensure that the version is correct even if the local libs are not up to date)
28
+ ESP_IDF_VERSION=$( grep " idf_ver:" .github/workflows/push.yml | sed ' s/.*release-v\([^"]*\).*/\1/' )
29
+ if [ -z " $ESP_IDF_VERSION " ]; then
30
+ echo " Error: ESP-IDF version not found in push.yml" >&2
31
+ exit 1
32
+ fi
33
+
26
34
echo " New Arduino Version: $ESP_ARDUINO_VERSION "
35
+ echo " ESP-IDF Version: $ESP_IDF_VERSION "
27
36
28
37
echo " Updating platform.txt..."
29
38
cat platform.txt | sed " s/version=.*/version=$ESP_ARDUINO_VERSION /g" > __platform.txt && mv __platform.txt platform.txt
30
39
31
40
echo " Updating package.json..."
32
41
cat package.json | sed " s/.*\" version\" :.*/ \" version\" : \" $ESP_ARDUINO_VERSION \" ,/g" > __package.json && mv __package.json package.json
33
42
43
+ echo " Updating docs/conf_common.py..."
44
+ cat docs/conf_common.py | \
45
+ sed " s/.. |version| replace:: .*/.. |version| replace:: $ESP_ARDUINO_VERSION /g" | \
46
+ sed " s/.. |idf_version| replace:: .*/.. |idf_version| replace:: $ESP_IDF_VERSION /g" > docs/__conf_common.py && mv docs/__conf_common.py docs/conf_common.py
47
+
34
48
echo " Updating cores/esp32/esp_arduino_version.h..."
35
49
cat cores/esp32/esp_arduino_version.h | \
36
50
sed " s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ESP_ARDUINO_VERSION_MAJOR /g" | \
0 commit comments