Skip to content

Commit f2d081f

Browse files
committed
Add helper script for updating the core version
1 parent 12c6599 commit f2d081f

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

Diff for: .github/scripts/update-version.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
if [ ! $# -eq 3 ]; then
4+
echo "Bad number of arguments: $#" >&2
5+
echo "usage: $0 <major> <minor> <patch>" >&2
6+
exit 1
7+
fi
8+
9+
re='^[0-9]+$'
10+
if [[ ! $1 =~ $re ]] || [[ ! $2 =~ $re ]] || [[ ! $3 =~ $re ]] ; then
11+
echo "error: Not a valid version: $1.$2.$3" >&2
12+
echo "usage: $0 <major> <minor> <patch>" >&2
13+
exit 1
14+
fi
15+
16+
ESP_ARDUINO_VERSION_MAJOR="$1"
17+
ESP_ARDUINO_VERSION_MINOR="$2"
18+
ESP_ARDUINO_VERSION_PATCH="$3"
19+
ESP_ARDUINO_VERSION="$ESP_ARDUINO_VERSION_MAJOR.$ESP_ARDUINO_VERSION_MINOR.$ESP_ARDUINO_VERSION_PATCH"
20+
21+
echo "New Arduino Version: $ESP_ARDUINO_VERSION"
22+
23+
echo "Updating platform.txt..."
24+
cat platform.txt | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > __platform.txt && mv __platform.txt platform.txt
25+
26+
echo "Updating package.json..."
27+
cat package.json | sed "s/.*\"version\":.*/ \"version\": \"$ESP_ARDUINO_VERSION\",/g" > __package.json && mv __package.json package.json
28+
29+
echo "Updating cores/esp32/esp_arduino_version.h..."
30+
cat cores/esp32/esp_arduino_version.h | \
31+
sed "s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ESP_ARDUINO_VERSION_MAJOR/g" | \
32+
sed "s/#define ESP_ARDUINO_VERSION_MINOR.*/#define ESP_ARDUINO_VERSION_MINOR $ESP_ARDUINO_VERSION_MINOR/g" | \
33+
sed "s/#define ESP_ARDUINO_VERSION_PATCH.*/#define ESP_ARDUINO_VERSION_PATCH $ESP_ARDUINO_VERSION_PATCH/g" > __esp_arduino_version.h && mv __esp_arduino_version.h cores/esp32/esp_arduino_version.h
34+
35+
exit 0

Diff for: cores/esp32/esp_arduino_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
/** Minor version number (x.X.x) */
2424
#define ESP_ARDUINO_VERSION_MINOR 0
2525
/** Patch version number (x.x.X) */
26-
#define ESP_ARDUINO_VERSION_PATCH 0
26+
#define ESP_ARDUINO_VERSION_PATCH 3
2727

2828
/**
2929
* Macro to convert ARDUINO version number into an integer

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "framework-arduinoespressif32",
3-
"version": "0.0.0",
3+
"version": "2.0.3",
44
"description": "Arduino Wiring-based Framework for the Espressif ESP32, ESP32-S and ESP32-C series of SoCs",
55
"keywords": [
66
"framework",

Diff for: platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32 Arduino
2-
version=2.0.0
2+
version=2.0.3
33

44
runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf
55
runtime.tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32s2-elf

0 commit comments

Comments
 (0)