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:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -3,6 +3,12 @@ name: PlatformIO CI
|
|||||||
# Only included into other workflows
|
# Only included into other workflows
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
nightly_build:
|
||||||
|
description: 'Flag to indicate this is a nightly build'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -62,6 +68,7 @@ jobs:
|
|||||||
- name: Build firmware
|
- name: Build firmware
|
||||||
env:
|
env:
|
||||||
WLED_RELEASE: True
|
WLED_RELEASE: True
|
||||||
|
WLED_NIGHTLY_BUILD: ${{ inputs.nightly_build && 'true' || 'false' }}
|
||||||
run: pio run -e ${{ matrix.environment }}
|
run: pio run -e ${{ matrix.environment }}
|
||||||
- name: Rename Bin
|
- name: Rename Bin
|
||||||
run: mv -v .pio/build/${{ matrix.environment }}/firmware.bin firmware-${{ matrix.environment }}.bin
|
run: mv -v .pio/build/${{ matrix.environment }}/firmware.bin firmware-${{ matrix.environment }}.bin
|
||||||
|
|||||||
8
.github/workflows/nightly.yml
vendored
8
.github/workflows/nightly.yml
vendored
@@ -10,6 +10,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
wled_build:
|
wled_build:
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
nightly_build: true
|
||||||
nightly:
|
nightly:
|
||||||
name: Deploy nightly
|
name: Deploy nightly
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -23,19 +25,19 @@ jobs:
|
|||||||
run: ls -la
|
run: ls -la
|
||||||
- name: "✏️ Generate release changelog"
|
- name: "✏️ Generate release changelog"
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: janheinrichmerker/action-github-changelog-generator@v2.3
|
uses: janheinrichmerker/action-github-changelog-generator@v2.4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
sinceTag: v14.7.1
|
sinceTag: v14.7.1
|
||||||
# Exclude issues that were closed without resolution from changelog
|
# Exclude issues that were closed without resolution from changelog
|
||||||
exclude-labels: 'stale,wontfix,duplicate,invalid'
|
excludeLabels: 'stale,wontfix,duplicate,invalid'
|
||||||
- name: Update Nightly Release
|
- name: Update Nightly Release
|
||||||
uses: andelf/nightly-release@main
|
uses: andelf/nightly-release@main
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: nightly
|
tag_name: nightly
|
||||||
name: 'Nightly Release $$'
|
name: 'Nightly mdev Build $$'
|
||||||
prerelease: true
|
prerelease: true
|
||||||
body: ${{ steps.changelog.outputs.changelog }}
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -20,13 +20,13 @@ jobs:
|
|||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: "✏️ Generate release changelog"
|
- name: "✏️ Generate release changelog"
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: janheinrichmerker/action-github-changelog-generator@v2.3
|
uses: janheinrichmerker/action-github-changelog-generator@v2.4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
sinceTag: v14.7.1
|
sinceTag: v14.7.1
|
||||||
maxIssues: 500
|
maxIssues: 500
|
||||||
# Exclude issues that were closed without resolution from changelog
|
# Exclude issues that were closed without resolution from changelog
|
||||||
exclude-labels: 'stale,wontfix,duplicate,invalid'
|
excludeLabels: 'stale,wontfix,duplicate,invalid'
|
||||||
- name: Create draft release
|
- name: Create draft release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
11
pio-scripts/set_nightly_version.py
Normal file
11
pio-scripts/set_nightly_version.py
Normal 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}")
|
||||||
|
|
||||||
@@ -224,6 +224,7 @@ ldscript_16m14m = eagle.flash.16m14m.ld
|
|||||||
[scripts_defaults]
|
[scripts_defaults]
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
pre:pio-scripts/set_version.py
|
pre:pio-scripts/set_version.py
|
||||||
|
pre:pio-scripts/set_nightly_version.py
|
||||||
pre:pio-scripts/build_ui.py
|
pre:pio-scripts/build_ui.py
|
||||||
pre:pio-scripts/conditional_usb_mode.py
|
pre:pio-scripts/conditional_usb_mode.py
|
||||||
pre:pio-scripts/set_repo.py
|
pre:pio-scripts/set_repo.py
|
||||||
|
|||||||
@@ -7,8 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#ifndef VERSION // WLEDMM allow override by nightly build script
|
#ifndef WLED_BUILD_VERSION // WLEDMM allow override by nightly build script
|
||||||
#define VERSION 2601151
|
#define VERSION 2601151
|
||||||
|
#else
|
||||||
|
#define VERSION WLED_BUILD_VERSION
|
||||||
#endif
|
#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.
|
// 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.
|
||||||
|
|||||||
Reference in New Issue
Block a user