Merge pull request #317 from MoonModules/copilot/update-nightly-build-version

Automate nightly build VERSION from build date, update Changelog generator to v2.4
This commit is contained in:
Frank Möhle
2026-01-15 20:34:09 +01:00
committed by GitHub
6 changed files with 30 additions and 7 deletions

View File

@@ -3,6 +3,12 @@ name: PlatformIO CI
# Only included into other workflows
on:
workflow_call:
inputs:
nightly_build:
description: 'Flag to indicate this is a nightly build'
required: false
type: boolean
default: false
jobs:
@@ -62,6 +68,7 @@ jobs:
- name: Build firmware
env:
WLED_RELEASE: True
WLED_NIGHTLY_BUILD: ${{ inputs.nightly_build && 'true' || 'false' }}
run: pio run -e ${{ matrix.environment }}
- name: Rename Bin
run: mv -v .pio/build/${{ matrix.environment }}/firmware.bin firmware-${{ matrix.environment }}.bin

View File

@@ -10,6 +10,8 @@ on:
jobs:
wled_build:
uses: ./.github/workflows/build.yml
with:
nightly_build: true
nightly:
name: Deploy nightly
runs-on: ubuntu-latest
@@ -23,19 +25,19 @@ jobs:
run: ls -la
- name: "✏️ Generate release changelog"
id: changelog
uses: janheinrichmerker/action-github-changelog-generator@v2.3
uses: janheinrichmerker/action-github-changelog-generator@v2.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: v14.7.1
# Exclude issues that were closed without resolution from changelog
exclude-labels: 'stale,wontfix,duplicate,invalid'
excludeLabels: 'stale,wontfix,duplicate,invalid'
- name: Update Nightly Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Nightly Release $$'
name: 'Nightly mdev Build $$'
prerelease: true
body: ${{ steps.changelog.outputs.changelog }}
files: |

View File

@@ -20,13 +20,13 @@ jobs:
merge-multiple: true
- name: "✏️ Generate release changelog"
id: changelog
uses: janheinrichmerker/action-github-changelog-generator@v2.3
uses: janheinrichmerker/action-github-changelog-generator@v2.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: v14.7.1
maxIssues: 500
# Exclude issues that were closed without resolution from changelog
exclude-labels: 'stale,wontfix,duplicate,invalid'
excludeLabels: 'stale,wontfix,duplicate,invalid'
- name: Create draft release
uses: softprops/action-gh-release@v1
with:

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"-DWLED_BUILD_VERSION={version_code}"])
print(f"Nightly build: Setting VERSION to {version_code}")

View File

@@ -224,6 +224,7 @@ 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

View File

@@ -7,8 +7,10 @@
*/
// version code in format yymmddb (b = daily build)
#ifndef VERSION // WLEDMM allow override by nightly build script
#define VERSION 2601151
#ifndef WLED_BUILD_VERSION // WLEDMM allow override by nightly build script
#define VERSION 2601151
#else
#define VERSION WLED_BUILD_VERSION
#endif
// WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED.