Implement nightly VERSION automation using PlatformIO script

- Created pio-scripts/set_nightly_version.py following existing set_version.py pattern
- Script sets VERSION to yymmddb format with build number 0 for nightly builds
- Modified build.yml to accept nightly_build boolean input
- Modified nightly.yml to pass nightly_build=true flag
- Added set_nightly_version.py to platformio.ini extra_scripts
- Uses WLED_NIGHTLY_BUILD environment variable to conditionally set VERSION

Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-15 10:11:48 +00:00
parent 8c70acad65
commit 39899c1061
4 changed files with 18 additions and 20 deletions

View File

@@ -0,0 +1,11 @@
Import('env')
import os
from datetime import datetime, timezone
# Only set VERSION if this is a nightly build (indicated by environment variable)
if os.environ.get('WLED_NIGHTLY_BUILD') == 'true':
# VERSION format: yymmddb (b = build number, 0 for nightly)
version_code = datetime.now(timezone.utc).strftime("%y%m%d") + "0"
env.Append(BUILD_FLAGS=[f"-DVERSION={version_code}"])
print(f"Nightly build: Setting VERSION to {version_code}")