Skip to content

Commit d84af8b

Browse files
authored
Merge branch 'espressif:master' into master
2 parents e24193e + b20655a commit d84af8b

File tree

128 files changed

+3842
-1051
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+3842
-1051
lines changed

‎.github/ISSUE_TEMPLATE/Issue-report.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ body:
4343
- latest stable Release (if not listed below)
4444
- latest development Release Candidate (RC-X)
4545
- latest master (checkout manually)
46+
- v3.3.2
4647
- v3.3.1
4748
- v3.3.0
4849
- v3.2.1

‎.github/scripts/find_new_boards.sh‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,25 @@ echo "$modified_lines"
2727
boards_array=()
2828
previous_board=""
2929

30+
# Define excluded entries that are not actual boards
31+
excluded_entries=("""+""-""esp32_family""menu")
32+
3033
# Extract board names from the modified lines, and add them to the boards_array
3134
whileread -r line;do
3235
board_name=$(echo "$line"| cut -d '.' -f1 | cut -d '#' -f1)
3336
# remove + or - from the board name at the beginning
3437
board_name=${board_name#[-+]}
35-
if [ "$board_name"!="" ] && [ "$board_name"!="+" ] && [ "$board_name"!="-" ] && [ "$board_name"!="esp32_family" ];then
38+
39+
# Check if board_name is in excluded entries
40+
is_excluded=false
41+
forexcludedin"${excluded_entries[@]}";do
42+
if [ "$board_name"="$excluded" ];then
43+
is_excluded=true
44+
break
45+
fi
46+
done
47+
48+
if [ "$is_excluded"=false ];then
3649
if [ "$board_name"!="$previous_board" ];then
3750
boards_array+=("espressif:esp32:$board_name")
3851
previous_board="$board_name"

‎.github/scripts/on-release.sh‎

Lines changed: 156 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,30 @@ if [ -n "${VENDOR}" ]; then
5454
echo"Setting packager: $VENDOR"
5555
fi
5656

57+
functionupdate_version{
58+
set -e
59+
set -o pipefail
60+
61+
local tag=$1
62+
local major
63+
local minor
64+
local patch
65+
66+
# Extract major, minor, and patch from the tag
67+
# We need to make sure to remove the "v" prefix from the tag and any characters after the patch version
68+
tag=$(echo "$tag"| sed 's/^v//g'| sed 's/-.*//g')
69+
major=$(echo "$tag"| cut -d. -f1)
70+
minor=$(echo "$tag"| cut -d. -f2)
71+
patch=$(echo "$tag"| cut -d. -f3 | sed 's/[^0-9].*//')# Remove non-numeric suffixes like RC1, alpha, beta
72+
73+
echo"Major: $major, Minor: $minor, Patch: $patch"
74+
75+
"${SCRIPTS_DIR}/update-version.sh""$major""$minor""$patch"
76+
77+
set +e
78+
set +o pipefail
79+
}
80+
5781
functionget_file_size{
5882
local file="$1"
5983
if [[ "$OSTYPE"=="darwin"* ]];then
@@ -199,8 +223,31 @@ set -e
199223
##
200224

201225
mkdir -p "$OUTPUT_DIR"
202-
PKG_DIR="$OUTPUT_DIR/$PACKAGE_NAME"
226+
PKG_DIR="${OUTPUT_DIR:?}/$PACKAGE_NAME"
203227
PACKAGE_ZIP="$PACKAGE_NAME.zip"
228+
PACKAGE_XZ="$PACKAGE_NAME.tar.xz"
229+
LIBS_ZIP="$PACKAGE_NAME-libs.zip"
230+
LIBS_XZ="$PACKAGE_NAME-libs.tar.xz"
231+
232+
echo"Updating version..."
233+
if! update_version "$RELEASE_TAG";then
234+
echo"ERROR: update_version failed!"
235+
exit 1
236+
fi
237+
git config --global github.user "github-actions[bot]"
238+
git config --global user.name "github-actions[bot]"
239+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
240+
git add .
241+
242+
# We should only commit if there are changes
243+
need_update_commit=true
244+
if git diff --cached --quiet;then
245+
echo"Version already updated"
246+
need_update_commit=false
247+
else
248+
echo"Creating version update commit..."
249+
git commit -m "change(version): Update core version to $RELEASE_TAG"
250+
fi
204251

205252
echo"Updating submodules ..."
206253
git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1
@@ -283,7 +330,7 @@ echo \#define ARDUINO_ESP32_GIT_DESC "$(git -C "$GITHUB_WORKSPACE" describe --ta
283330
echo\#define ARDUINO_ESP32_RELEASE_"$ver_define">>"$PKG_DIR/cores/esp32/core_version.h"
284331
echo\#define ARDUINO_ESP32_RELEASE \""$ver_define"\">>"$PKG_DIR/cores/esp32/core_version.h"
285332

286-
# Compress package folder
333+
# Compress ZIP package folder
287334
echo"Creating ZIP ..."
288335
pushd"$OUTPUT_DIR">/dev/null
289336
zip -qr "$PACKAGE_ZIP""$PACKAGE_NAME"
@@ -293,22 +340,113 @@ if [ $? -ne 0 ]; then
293340
fi
294341

295342
# Calculate SHA-256
296-
echo"Calculating SHA sum ..."
297-
PACKAGE_PATH="$OUTPUT_DIR/$PACKAGE_ZIP"
343+
echo"Calculating ZIP SHA sum ..."
344+
PACKAGE_PATH="${OUTPUT_DIR:?}/$PACKAGE_ZIP"
298345
PACKAGE_SHA=$(shasum -a 256 "$PACKAGE_ZIP"| cut -f 1 -d '')
299346
PACKAGE_SIZE=$(get_file_size "$PACKAGE_ZIP")
300347
popd>/dev/null
301-
rm -rf "$PKG_DIR"
302348
echo"'$PACKAGE_ZIP' Created! Size: $PACKAGE_SIZE, SHA-256: $PACKAGE_SHA"
303349
echo
304350

305-
# Upload package to release page
306-
echo"Uploading package to release page ..."
351+
# Compress XZ package folder
352+
echo"Creating XZ ..."
353+
pushd"$OUTPUT_DIR">/dev/null
354+
tar -cJf "$PACKAGE_XZ""$PACKAGE_NAME"
355+
if [ $?-ne 0 ];then
356+
echo"ERROR: Failed to create $PACKAGE_XZ ($?)"
357+
exit 1
358+
fi
359+
360+
# Calculate SHA-256
361+
echo"Calculating XZ SHA sum ..."
362+
PACKAGE_XZ_PATH="${OUTPUT_DIR:?}/$PACKAGE_XZ"
363+
PACKAGE_XZ_SHA=$(shasum -a 256 "$PACKAGE_XZ"| cut -f 1 -d '')
364+
PACKAGE_XZ_SIZE=$(get_file_size "$PACKAGE_XZ")
365+
popd>/dev/null
366+
echo"'$PACKAGE_XZ' Created! Size: $PACKAGE_XZ_SIZE, SHA-256: $PACKAGE_XZ_SHA"
367+
echo
368+
369+
# Upload ZIP package to release page
370+
echo"Uploading ZIP package to release page ..."
307371
PACKAGE_URL=$(git_safe_upload_asset "$PACKAGE_PATH")
308372
echo"Package Uploaded"
309373
echo"Download URL: $PACKAGE_URL"
310374
echo
311375

376+
# Upload XZ package to release page
377+
echo"Uploading XZ package to release page ..."
378+
PACKAGE_XZ_URL=$(git_safe_upload_asset "$PACKAGE_XZ_PATH")
379+
echo"Package Uploaded"
380+
echo"Download URL: $PACKAGE_XZ_URL"
381+
echo
382+
383+
# Remove package folder
384+
rm -rf "$PKG_DIR"
385+
386+
# Copy Libs from lib-builder to release in ZIP and XZ
387+
388+
libs_url=$(cat "$PACKAGE_JSON_TEMPLATE"| jq -r ".packages[0].tools[] | select(.name == \"esp32-arduino-libs\") | .systems[0].url")
389+
libs_sha=$(cat "$PACKAGE_JSON_TEMPLATE"| jq -r ".packages[0].tools[] | select(.name == \"esp32-arduino-libs\") | .systems[0].checksum"| sed 's/^SHA-256://')
390+
libs_size=$(cat "$PACKAGE_JSON_TEMPLATE"| jq -r ".packages[0].tools[] | select(.name == \"esp32-arduino-libs\") | .systems[0].size")
391+
echo"Downloading libs from lib-builder ..."
392+
echo"URL: $libs_url"
393+
echo"Expected SHA: $libs_sha"
394+
echo"Expected Size: $libs_size"
395+
echo
396+
397+
echo"Downloading libs from lib-builder ..."
398+
curl -L -o "$OUTPUT_DIR/$LIBS_ZIP""$libs_url"
399+
400+
# Check SHA and Size
401+
zip_sha=$(sha256sum "$OUTPUT_DIR/$LIBS_ZIP"| awk '{print $1}')
402+
zip_size=$(stat -c%s "$OUTPUT_DIR/$LIBS_ZIP")
403+
echo"Downloaded SHA: $zip_sha"
404+
echo"Downloaded Size: $zip_size"
405+
if [ "$zip_sha"!="$libs_sha" ] || [ "$zip_size"!="$libs_size" ];then
406+
echo"ERROR: ZIP SHA and Size do not match"
407+
exit 1
408+
fi
409+
410+
# Extract ZIP
411+
412+
echo"Repacking libs to XZ ..."
413+
unzip -q "$OUTPUT_DIR/$LIBS_ZIP" -d "$OUTPUT_DIR"
414+
pushd"$OUTPUT_DIR">/dev/null
415+
tar -cJf "$LIBS_XZ""esp32-arduino-libs"
416+
popd>/dev/null
417+
418+
# Upload ZIP and XZ libs to release page
419+
420+
echo"Uploading ZIP libs to release page ..."
421+
LIBS_ZIP_URL=$(git_safe_upload_asset "$OUTPUT_DIR/$LIBS_ZIP")
422+
echo"ZIP libs Uploaded"
423+
echo"Download URL: $LIBS_ZIP_URL"
424+
echo
425+
426+
echo"Uploading XZ libs to release page ..."
427+
LIBS_XZ_URL=$(git_safe_upload_asset "$OUTPUT_DIR/$LIBS_XZ")
428+
echo"XZ libs Uploaded"
429+
echo"Download URL: $LIBS_XZ_URL"
430+
echo
431+
432+
# Update libs URLs in JSON template
433+
echo"Updating libs URLs in JSON template ..."
434+
435+
# Update all libs URLs in the JSON template
436+
libs_jq_arg="(.packages[0].tools[] | select(.name == \"esp32-arduino-libs\") | .systems[].url) = \"$LIBS_ZIP_URL\" |\
437+
(.packages[0].tools[] | select(.name == \"esp32-arduino-libs\") | .systems[].archiveFileName) = \"$LIBS_ZIP\""
438+
439+
cat "$PACKAGE_JSON_TEMPLATE"| jq "$libs_jq_arg">"$OUTPUT_DIR/package-libs-updated.json"
440+
PACKAGE_JSON_TEMPLATE="$OUTPUT_DIR/package-libs-updated.json"
441+
442+
echo"Libs URLs updated in JSON template"
443+
echo
444+
445+
# Clean up
446+
rm -rf "${OUTPUT_DIR:?}/esp32-arduino-libs"
447+
rm -rf "${OUTPUT_DIR:?}/$LIBS_ZIP"
448+
rm -rf "${OUTPUT_DIR:?}/$LIBS_XZ"
449+
312450
##
313451
## TEMP WORKAROUND FOR RV32 LONG PATH ON WINDOWS
314452
##
@@ -469,6 +607,17 @@ if [ "$RELEASE_PRE" == "false" ]; then
469607
echo
470608
fi
471609

610+
if [ "$need_update_commit"=="true" ];then
611+
echo"Pushing version update commit..."
612+
git push
613+
new_tag_commit=$(git rev-parse HEAD)
614+
echo"New commit: $new_tag_commit"
615+
616+
echo"Moving tag $RELEASE_TAG to $new_tag_commit..."
617+
git tag -f "$RELEASE_TAG""$new_tag_commit"
618+
git push --force origin "$RELEASE_TAG"
619+
fi
620+
472621
set +e
473622

474623
##

‎.github/scripts/tests_matrix.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ targets="'esp32','esp32s2','esp32s3','esp32c3','esp32c6','esp32h2','esp32p4'"
1717
mkdir -p info
1818

1919
echo"[$wokwi_types]"> info/wokwi_types.txt
20+
echo"[$hw_types]"> info/hw_types.txt
2021
echo"[$targets]"> info/targets.txt
2122

2223
{

‎.github/scripts/tests_run.sh‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ function run_test{
8888
fi
8989

9090
if [ $platform=="wokwi" ];then
91-
extra_args=("--target""$target""--embedded-services""arduino,wokwi""--wokwi-timeout=$wokwi_timeout")
92-
if [[ -f"$sketchdir/scenario.yaml" ]];then
93-
extra_args+=("--wokwi-scenario""$sketchdir/scenario.yaml")
94-
fi
91+
extra_args=("--target""$target""--embedded-services""arduino,wokwi")
9592
if [[ -f"$sketchdir/diagram.$target.json" ]];then
9693
extra_args+=("--wokwi-diagram""$sketchdir/diagram.$target.json")
9794
fi
@@ -137,7 +134,6 @@ SCRIPTS_DIR="./.github/scripts"
137134
COUNT_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh count"
138135

139136
platform="hardware"
140-
wokwi_timeout=60000
141137
chunk_run=0
142138
options=0
143139
erase=0
@@ -156,7 +152,6 @@ while [ -n "$1" ]; do
156152
;
157153
-W )
158154
shift
159-
wokwi_timeout=$1
160155
if [[ -z$WOKWI_CLI_TOKEN ]];then
161156
echo"Wokwi CLI token is not set"
162157
exit 1

‎.github/scripts/update-version.sh‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Disable shellcheck warning about using 'cat' to read a file.
33
# shellcheck disable=SC2002
44

5+
# Exit on any error and make pipelines fail if any command fails
6+
set -e
7+
set -o pipefail
8+
59
# For reference: add tools for all boards by replacing one line in each board
610
# "[board].upload.tool=esptool_py" to "[board].upload.tool=esptool_py\n[board].upload.tool.default=esptool_py\n[board].upload.tool.network=esp_ota"
711
#cat boards.txt | sed "s/\([a-zA-Z0-9_\-]*\)\.upload\.tool\=esptool_py/\1\.upload\.tool\=esptool_py\\n\1\.upload\.tool\.default\=esptool_py\\n\1\.upload\.tool\.network\=esp_ota/"
@@ -35,8 +39,18 @@ echo "New Arduino Version: $ESP_ARDUINO_VERSION"
3539
echo"ESP-IDF Version: $ESP_IDF_VERSION"
3640

3741
echo"Updating issue template..."
38-
cat .github/ISSUE_TEMPLATE/Issue-report.yml | \
39-
sed "s/.*\- latest master .*/ - latest master \(checkout manually\)\\n - v$ESP_ARDUINO_VERSION/g"> __issue-report.yml && mv __issue-report.yml .github/ISSUE_TEMPLATE/Issue-report.yml
42+
if! grep -q "v$ESP_ARDUINO_VERSION" .github/ISSUE_TEMPLATE/Issue-report.yml;then
43+
cat .github/ISSUE_TEMPLATE/Issue-report.yml | \
44+
sed "s/.*\- latest master .*/ - latest master \(checkout manually\)\\n - v$ESP_ARDUINO_VERSION/g"> __issue-report.yml && mv __issue-report.yml .github/ISSUE_TEMPLATE/Issue-report.yml
45+
echo"Issue template updated with version v$ESP_ARDUINO_VERSION"
46+
else
47+
echo"Version v$ESP_ARDUINO_VERSION already exists in issue template, skipping update"
48+
fi
49+
50+
echo"Updating GitLab variables..."
51+
cat .gitlab/workflows/common.yml | \
52+
sed "s/ESP_IDF_VERSION:.*/ESP_IDF_VERSION: \"$ESP_IDF_VERSION\"/g"| \
53+
sed "s/ESP_ARDUINO_VERSION:.*/ESP_ARDUINO_VERSION: \"$ESP_ARDUINO_VERSION\"/g"> .gitlab/workflows/__common.yml && mv .gitlab/workflows/__common.yml .gitlab/workflows/common.yml
4054

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

0 commit comments

Comments
(0)