diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b02fab449..6adce30903 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d64b7f13e0..e506cdc478 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6b92a092f..8d04e6a3e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/pio-scripts/set_nightly_version.py b/pio-scripts/set_nightly_version.py new file mode 100644 index 0000000000..176cd98848 --- /dev/null +++ b/pio-scripts/set_nightly_version.py @@ -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}") + diff --git a/platformio.ini b/platformio.ini index 2a5a707aa7..ebc4ec0aec 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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 diff --git a/wled00/wled.h b/wled00/wled.h index ce6aaec40a..e5047aa590 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -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.