Fix setupui (#1777)

* Enhance GitHub Actions artifact download script

- Updated the output directory structure to save downloaded files in a version-specific subdirectory (releases/<version>).
- Added a new function to determine the default releases directory path relative to the script's location.
- Improved artifact renaming logic to handle known extensions more robustly and ensure compatibility with filenames containing dots.

* Refactor UI setup in ElectronEmojiDisplay and OttoEmojiDisplay classes

- Moved SetupChatLabel call in ElectronEmojiDisplay to ensure it is executed after the parent UI is initialized, preventing potential issues with container validity.
- Updated SetupUI in OttoEmojiDisplay to release the display lock before calling SetEmotion, avoiding deadlock scenarios during UI setup.

* Add multiline chat message support in display configuration

- Introduced a new Kconfig option to enable multiline chat message display in the default mode.
- Updated the LCD display setup to accommodate a dynamic height bottom bar for multiline messages.
- Modified the configuration files for the waveshare-esp32-s3-epaper-1.54 board to include the new chat message setting.

* Update font and emoji settings for Magiclick boards; enhance bottom bar visibility logic in LCD display

- Changed the default text and emoji fonts for Magiclick S3 2P4 and S3 2P5 boards to Noto fonts.
- Improved bottom bar visibility logic in LcdDisplay to hide when there is no content, ensuring a cleaner UI experience.
This commit is contained in:
Xiaoxia
2026-02-19 20:10:27 +08:00
committed by GitHub
parent 4666ecef82
commit 71c86ab62b
10 changed files with 145 additions and 45 deletions

View File

@ -4,6 +4,10 @@ Download GitHub Actions artifacts and rename them with version numbers.
Usage:
python download_github_runs.py 2.0.4 https://github.com/78/xiaozhi-esp32/actions/runs/18866246016
Output:
Files are downloaded to releases/<version>/ directory relative to the project root.
Example: releases/2.0.4/v2.0.4_atk-dnesp32s3-box0.zip
"""
import argparse
@ -147,12 +151,17 @@ def rename_artifact(original_name: str, version: str) -> str:
if name.startswith("xiaozhi_"):
name = name[len("xiaozhi_"):]
# Remove extension
name_without_ext = os.path.splitext(name)[0]
# Remove known extensions only (not using splitext to avoid issues with
# names containing dots like "esp32-s3-touch-amoled-2.06")
known_extensions = ('.bin', '.zip')
for ext in known_extensions:
if name.endswith(ext):
name = name[:-len(ext)]
break
# Remove hash suffix (pattern: underscore followed by 40+ hex characters)
# This matches Git commit hashes and similar identifiers
name_without_hash = re.sub(r'_[a-f0-9]{40,}$', '', name_without_ext)
name_without_hash = re.sub(r'_[a-f0-9]{40,}$', '', name)
# Add version prefix and .zip extension
new_name = f"v{version}_{name_without_hash}.zip"
@ -160,6 +169,17 @@ def rename_artifact(original_name: str, version: str) -> str:
return new_name
def get_default_releases_dir() -> Path:
"""
Get the default releases directory path relative to this script's location.
Returns:
Path to the releases directory (script_dir/../releases)
"""
script_dir = Path(__file__).resolve().parent
return script_dir.parent / "releases"
def main():
"""Main function to download and rename GitHub Actions artifacts."""
parser = argparse.ArgumentParser(
@ -175,8 +195,8 @@ def main():
)
parser.add_argument(
"--output-dir",
default="../releases",
help="Output directory for downloaded artifacts (default: ../releases)"
default=None,
help="Output directory for downloaded artifacts (default: releases/<version> relative to project root)"
)
args = parser.parse_args()
@ -211,8 +231,15 @@ def main():
print(f" - {artifact['name']}")
print()
# Determine output directory
if args.output_dir:
# User specified custom output directory
output_dir = Path(args.output_dir) / args.version
else:
# Default: releases/<version> relative to script location
output_dir = get_default_releases_dir() / args.version
# Create output directory
output_dir = Path(args.output_dir)
output_dir.mkdir(parents=True, exist_ok=True)
# Download and rename each artifact