-
-
Notifications
You must be signed in to change notification settings - Fork 89
Add merged binaries to release assets #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| param( | ||
| # "--chip esp32s3" is irrelevant, just need to be added, fallback to "esp32s3" | ||
| [string]$chip = "esp32s3" | ||
| ) | ||
|
|
||
| if ($null -eq (Get-Command "esptool" -ErrorAction SilentlyContinue)) | ||
| { | ||
| Write-Host "Unable to find esptool in your path. Make sure you have Python installed and on your path. Then run `pip install esptool`." | ||
| exit 1 | ||
| } | ||
|
|
||
| # Create merge command based on partitions | ||
| $json = Get-Content .\Binaries\flasher_args.json -Raw | ConvertFrom-Json | ||
| $jsonClean = $json.flash_files -replace '[\{\}\@\;]', '' | ||
| $jsonClean = $jsonClean -replace '[\=]', ' ' | ||
|
|
||
| $mergeArgs = @('--chip', $chip, 'merge-bin', '--output', 'merged_binary.bin') + ($jsonClean -split '\s+' | Where-Object { $_ }) | ||
| Push-Location Binaries | ||
| & esptool @mergeArgs | ||
| $exitCode = $LASTEXITCODE | ||
| Pop-Location | ||
|
|
||
| if ($exitCode -ne 0) { | ||
| exit $exitCode | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Usage: | ||
| # merge.sh [chip] | ||
| # | ||
| # Arguments: | ||
| # chip - optional ESP32 SOC variant (e.g. esp32, esp32s3, esp32c6) | ||
| # | ||
| # Requirements: | ||
| # jq - run 'pip install jq' | ||
| # esptool.py - run 'pip install esptool' | ||
| # | ||
| # Documentation: | ||
| # https://docs.espressif.com/projects/esptool/en/latest/esp32/ | ||
| # | ||
|
|
||
| # Source: https://stackoverflow.com/a/53798785 | ||
| function is_bin_in_path { | ||
| builtin type -P "$1" &> /dev/null | ||
| } | ||
|
|
||
| function require_bin { | ||
| program=$1 | ||
| if ! is_bin_in_path $program; then | ||
| exit 1 | ||
| else | ||
| exit 0 | ||
| fi | ||
| } | ||
|
|
||
| # Find either esptool (installed via system package manager) or esptool.py (installed via pip) | ||
| if ! is_bin_in_path esptool; then | ||
| if ! is_bin_in_path esptool.py; then | ||
| echo "\e[31m⚠️ esptool not found! Install it from your package manager or install python and run 'pip install esptool'\e[0m" | ||
| exit 1 | ||
| else | ||
| esptoolPath=esptool.py | ||
| fi | ||
| else | ||
| esptoolPath=esptool | ||
| fi | ||
|
|
||
| chip=${1:-esp32s3} | ||
|
|
||
| # Take the flash_arg file contents and join each line in the file into a single line | ||
| flash_args="$(tr '\n' ' ' < Binaries/flash_args)" | ||
| read -r -a flash_args_array <<< "$flash_args" | ||
| ( | ||
| cd Binaries || exit 1 | ||
| "$esptoolPath" --chip "$chip" merge-bin --output merged_binary.bin "${flash_args_array[@]}" | ||
| ) || exit 1 | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.