Skip to content

Commit fbf3c11

Browse files
authored
Merge branch 'master' into release/v3.3.x
2 parents df3db3c + 87b718a commit fbf3c11

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

.github/scripts/merge_packages.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Usage:
55
# python merge_packages.py package_esp8266com_index.json version/new/package_esp8266com_index.json
66
# Written by Ivan Grokhotkov, 2015
7+
# Updated by lucasssvaz to handle Chinese version sorting, 2025
78
#
89

910
from __future__ import print_function
@@ -36,20 +37,19 @@ def merge_objects(versions, obj):
3637

3738

3839
# Normalize ESP release version string (x.x.x) by adding '-rc<MAXINT>' (x.x.x-rc9223372036854775807)
39-
# to ensure having REL above any RC
40+
# to ensure having REL above any RC. CN version will be sorted after the official version if they happen
41+
# to be mixed (normally, CN and non-CN versions should not be mixed)
4042
# Dummy approach, functional anyway for current ESP package versioning
4143
# (unlike NormalizedVersion/LooseVersion/StrictVersion & similar crap)
4244
def pkgVersionNormalized(versionString):
43-
44-
verStr = str(versionString)
45+
verStr = str(versionString).replace("-cn", "")
4546
verParts = re.split(r"\.|-rc|-alpha", verStr, flags=re.IGNORECASE)
4647

4748
if len(verParts) == 3:
48-
if sys.version_info > (3, 0): # Python 3
49-
verStr = str(versionString) + "-rc" + str(sys.maxsize)
50-
else: # Python 2
51-
verStr = str(versionString) + "-rc" + str(sys.maxint)
52-
49+
if "-cn" in str(versionString):
50+
verStr = verStr + "-rc" + str(sys.maxsize // 2)
51+
else:
52+
verStr = verStr + "-rc" + str(sys.maxsize)
5353
elif len(verParts) != 4:
5454
print("pkgVersionNormalized WARNING: unexpected version format: {0})".format(verStr), file=sys.stderr)
5555

.github/scripts/release_append_cn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
def append_cn_to_versions(obj):
1919
if isinstance(obj, dict):
20-
# dfu-util comes from arduino.cc and not from the Chinese mirrors, so we skip it
21-
if obj.get("name") == "dfu-util":
20+
# Skip tools that are not from the esp32 package
21+
packager = obj.get("packager")
22+
if packager is not None and packager != "esp32":
2223
return
2324

2425
for key, value in obj.items():

.github/scripts/update-version.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# Disable shellcheck warning about using 'cat' to read a file.
23
# shellcheck disable=SC2002
34

45
# For reference: add tools for all boards by replacing one line in each board
@@ -23,14 +24,27 @@ ESP_ARDUINO_VERSION_MINOR="$2"
2324
ESP_ARDUINO_VERSION_PATCH="$3"
2425
ESP_ARDUINO_VERSION="$ESP_ARDUINO_VERSION_MAJOR.$ESP_ARDUINO_VERSION_MINOR.$ESP_ARDUINO_VERSION_PATCH"
2526

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+
2634
echo "New Arduino Version: $ESP_ARDUINO_VERSION"
35+
echo "ESP-IDF Version: $ESP_IDF_VERSION"
2736

2837
echo "Updating platform.txt..."
2938
cat platform.txt | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > __platform.txt && mv __platform.txt platform.txt
3039

3140
echo "Updating package.json..."
3241
cat package.json | sed "s/.*\"version\":.*/ \"version\": \"$ESP_ARDUINO_VERSION\",/g" > __package.json && mv __package.json package.json
3342

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+
3448
echo "Updating cores/esp32/esp_arduino_version.h..."
3549
cat cores/esp32/esp_arduino_version.h | \
3650
sed "s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ESP_ARDUINO_VERSION_MAJOR/g" | \

docs/conf_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Used for substituting variables in the documentation
66
rst_prolog = """
7-
.. |version| replace:: 3.2.0
7+
.. |version| replace:: 3.2.1
88
.. |idf_version| replace:: 5.4
99
"""
1010

0 commit comments

Comments
 (0)