Skip to content

Commit a63977a

Browse files
authored
Merge pull request #11845 from lucasssvaz/update-esptool-5.1.0
change(esptool): Upgrade to version 5.1.0
2 parents d17f9c0 + 2445c16 commit a63977a

File tree

2 files changed

+60
-30
lines changed

2 files changed

+60
-30
lines changed

.github/scripts/update_esptool.py

100644100755
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import os
3434
import shutil
3535
import stat
36+
import subprocess
3637
import tarfile
3738
import zipfile
3839
import hashlib
@@ -201,10 +202,34 @@ def get_release_info(version):
201202
response.raise_for_status()
202203
return response.json()
203204

205+
def create_branch_and_commit(version, json_path):
206+
"""Create a new branch and commit the changes to it."""
207+
branch_name = f"update-esptool-{version}"
208+
commit_message = f"change(esptool): Upgrade to version {version}"
209+
210+
try:
211+
# Create and checkout new branch
212+
subprocess.run(["git", "checkout", "-b", branch_name], check=True, capture_output=True, text=True)
213+
print(f"Created and switched to new branch: {branch_name}")
214+
215+
# Stage the JSON file
216+
subprocess.run(["git", "add", str(json_path)], check=True, capture_output=True, text=True)
217+
print(f"Staged file: {json_path}")
218+
219+
# Commit the changes
220+
subprocess.run(["git", "commit", "-m", commit_message], check=True, capture_output=True, text=True)
221+
print(f"Committed changes with message: {commit_message}")
222+
223+
except subprocess.CalledProcessError as e:
224+
print(f"Git operation failed: {e}")
225+
print(f"Command output: {e.stderr if e.stderr else e.stdout}")
226+
raise
227+
204228
def main():
205229
parser = argparse.ArgumentParser(description="Repack esptool and update JSON metadata.")
206230
parser.add_argument("version", help="Version of the esptool (e.g. 5.0.dev1)")
207231
parser.add_argument("-l", "--local", dest="base_folder", help="Enable local build mode and set the base folder with unpacked artifacts")
232+
parser.add_argument("-c", "--commit", action="store_true", help="Automatically create a new branch and commit the JSON file changes")
208233
args = parser.parse_args()
209234

210235
script_dir = Path(__file__).resolve().parent
@@ -232,5 +257,10 @@ def main():
232257
shutil.move(tmp_json_path, json_path)
233258
print(f"Done. JSON updated at {json_path}")
234259

260+
# Auto-commit if requested
261+
if args.commit:
262+
print("Auto-commit enabled. Creating branch and committing changes...")
263+
create_branch_and_commit(args.version, json_path)
264+
235265
if __name__ == "__main__":
236266
main()

package/package_esp32_index.template.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
{
8282
"packager": "esp32",
8383
"name": "esptool_py",
84-
"version": "5.0.2"
84+
"version": "5.1.0"
8585
},
8686
{
8787
"packager": "esp32",
@@ -469,56 +469,56 @@
469469
},
470470
{
471471
"name": "esptool_py",
472-
"version": "5.0.2",
472+
"version": "5.1.0",
473473
"systems": [
474474
{
475475
"host": "aarch64-linux-gnu",
476-
"url": "https://github.com/espressif/esptool/releases/download/v5.0.2/esptool-v5.0.2-linux-aarch64.tar.gz",
477-
"archiveFileName": "esptool-v5.0.2-linux-aarch64.tar.gz",
478-
"checksum": "SHA-256:0c1fa4f5e96f715133fa65572063fa65bd120cd941b667cecd3360436a62b97b",
479-
"size": "57815944"
476+
"url": "https://github.com/espressif/esptool/releases/download/v5.1.0/esptool-v5.1.0-linux-aarch64.tar.gz",
477+
"archiveFileName": "esptool-v5.1.0-linux-aarch64.tar.gz",
478+
"checksum": "SHA-256:d2b60d4570cd4919b87eddcbeaab2e0411548b5aab865c234aed8ecc8e5403ac",
479+
"size": "56292242"
480480
},
481481
{
482482
"host": "x86_64-pc-linux-gnu",
483-
"url": "https://github.com/espressif/esptool/releases/download/v5.0.2/esptool-v5.0.2-linux-amd64.tar.gz",
484-
"archiveFileName": "esptool-v5.0.2-linux-amd64.tar.gz",
485-
"checksum": "SHA-256:519e0015872d527bdca850b18575d4f635fa88ccdffe47a14c99a80a90b780c5",
486-
"size": "100787554"
483+
"url": "https://github.com/espressif/esptool/releases/download/v5.1.0/esptool-v5.1.0-linux-amd64.tar.gz",
484+
"archiveFileName": "esptool-v5.1.0-linux-amd64.tar.gz",
485+
"checksum": "SHA-256:49d572d50f6b1f089d1d81d3bd3bd357fbcc40f4f8fd4874f2dc51ad534abb01",
486+
"size": "57690602"
487487
},
488488
{
489489
"host": "arm-linux-gnueabihf",
490-
"url": "https://github.com/espressif/esptool/releases/download/v5.0.2/esptool-v5.0.2-linux-armv7.tar.gz",
491-
"archiveFileName": "esptool-v5.0.2-linux-armv7.tar.gz",
492-
"checksum": "SHA-256:8df698d46a64b0b4a36d2a5bbd6bae58f81ca0a5e6451cd3f2d69a33340cc0f1",
493-
"size": "53046401"
490+
"url": "https://github.com/espressif/esptool/releases/download/v5.1.0/esptool-v5.1.0-linux-armv7.tar.gz",
491+
"archiveFileName": "esptool-v5.1.0-linux-armv7.tar.gz",
492+
"checksum": "SHA-256:e22ecb0293fe73c80d0a5fd05873f9ea49a68985b16991cf5980d2b90c8c7276",
493+
"size": "53396928"
494494
},
495495
{
496496
"host": "x86_64-apple-darwin",
497-
"url": "https://github.com/espressif/esptool/releases/download/v5.0.2/esptool-v5.0.2-macos-amd64.tar.gz",
498-
"archiveFileName": "esptool-v5.0.2-macos-amd64.tar.gz",
499-
"checksum": "SHA-256:5c27295975515b97a9280f46845bd3acd5fc9e6a0583cfe03efa66cc50195ab0",
500-
"size": "59619952"
497+
"url": "https://github.com/espressif/esptool/releases/download/v5.1.0/esptool-v5.1.0-macos-amd64.tar.gz",
498+
"archiveFileName": "esptool-v5.1.0-macos-amd64.tar.gz",
499+
"checksum": "SHA-256:c485511e0906cb1e0277c5eecff1c4a77b89d76d0c940b685dc9fce2fad4b242",
500+
"size": "59088390"
501501
},
502502
{
503503
"host": "arm64-apple-darwin",
504-
"url": "https://github.com/espressif/esptool/releases/download/v5.0.2/esptool-v5.0.2-macos-arm64.tar.gz",
505-
"archiveFileName": "esptool-v5.0.2-macos-arm64.tar.gz",
506-
"checksum": "SHA-256:93f0d9ef169f9bc6e32ed6f381977f63a5df7483b8002a5676dddf055bdbf775",
507-
"size": "56344929"
504+
"url": "https://github.com/espressif/esptool/releases/download/v5.1.0/esptool-v5.1.0-macos-arm64.tar.gz",
505+
"archiveFileName": "esptool-v5.1.0-macos-arm64.tar.gz",
506+
"checksum": "SHA-256:5d5aab5b64b10dc5001cfa96b5bfa48393ae561e6d797c41a1fdd3f5d3843d03",
507+
"size": "56092727"
508508
},
509509
{
510510
"host": "x86_64-mingw32",
511-
"url": "https://github.com/espressif/esptool/releases/download/v5.0.2/esptool-v5.0.2-windows-amd64.zip",
512-
"archiveFileName": "esptool-v5.0.2-windows-amd64.zip",
513-
"checksum": "SHA-256:1caef993a16c5915714a0da772d93f2e3239f316c06223981b262b838287268c",
514-
"size": "59097582"
511+
"url": "https://github.com/espressif/esptool/releases/download/v5.1.0/esptool-v5.1.0-windows-amd64.zip",
512+
"archiveFileName": "esptool-v5.1.0-windows-amd64.zip",
513+
"checksum": "SHA-256:f68a8f7728adfc59cd60f9424928199e76eac66372c7bdc23898aa32753a437a",
514+
"size": "59936293"
515515
},
516516
{
517517
"host": "i686-mingw32",
518-
"url": "https://github.com/espressif/esptool/releases/download/v5.0.2/esptool-v5.0.2-windows-amd64.zip",
519-
"archiveFileName": "esptool-v5.0.2-windows-amd64.zip",
520-
"checksum": "SHA-256:1caef993a16c5915714a0da772d93f2e3239f316c06223981b262b838287268c",
521-
"size": "59097582"
518+
"url": "https://github.com/espressif/esptool/releases/download/v5.1.0/esptool-v5.1.0-windows-amd64.zip",
519+
"archiveFileName": "esptool-v5.1.0-windows-amd64.zip",
520+
"checksum": "SHA-256:f68a8f7728adfc59cd60f9424928199e76eac66372c7bdc23898aa32753a437a",
521+
"size": "59936293"
522522
}
523523
]
524524
},

0 commit comments

Comments
 (0)