Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wled",
"version": "14.7.2-mdev",
"version": "14.7.2-nightly",
Comment thread
softhack007 marked this conversation as resolved.
Outdated
"description": "Tools for WLED-MM project",
"main": "tools/cdata.js",
"directories": {
Expand Down
11 changes: 0 additions & 11 deletions pio-scripts/set_nightly_version.py

This file was deleted.

25 changes: 23 additions & 2 deletions pio-scripts/set_version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
Import('env')
Import('env') # PlatformIO-specific import
import json
import os
from datetime import datetime, timezone

PACKAGE_FILE = "package.json"

with open(PACKAGE_FILE, "r") as package:
version = json.load(package)["version"]
env.Append(BUILD_FLAGS=[f"-DWLED_VERSION={version}"])
Comment thread
softhack007 marked this conversation as resolved.

# Handle nightly build
if os.environ.get('WLED_NIGHTLY_BUILD') == 'true':
Comment thread
softhack007 marked this conversation as resolved.
Outdated
# 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"-DWLED_BUILD_VERSION={version_code}"])
print(f"Nightly build: Setting VERSION to {version_code}")

# Update version tag: replace "-mdev" with "-nightly" or append "-nightly" if no tag
if "-mdev" in version:
Comment thread
softhack007 marked this conversation as resolved.
Outdated
version = version.replace("-mdev", "-nightly")
elif "-" in version:
# Replace any existing tag with -nightly (handles multiple hyphens correctly)
version = version.rsplit("-", 1)[0] + "-nightly"
else:
# No tag present, append -nightly
version = version + "-nightly"
print(f"Nightly build: Using version string {version}")

env.Append(BUILD_FLAGS=[f"-DWLED_VERSION={version}"])
1 change: 0 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ ldscript_16m14m = eagle.flash.16m14m.ld
[scripts_defaults]
extra_scripts =
pre:pio-scripts/set_version.py
pre:pio-scripts/set_nightly_version.py
pre:pio-scripts/build_ui.py
pre:pio-scripts/conditional_usb_mode.py
pre:pio-scripts/set_repo.py
Expand Down