Add automatic VERSION setting for nightly builds
- Modified build.yml to accept optional version input parameter - Modified nightly.yml to calculate VERSION from build date in format yymmddb - VERSION is passed as PLATFORMIO_BUILD_FLAGS to override default in wled.h - Other workflows (wled-ci.yml, release.yml) unchanged and will use default VERSION Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
This commit is contained in:
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -3,6 +3,11 @@ name: PlatformIO CI
|
|||||||
# Only included into other workflows
|
# Only included into other workflows
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Build VERSION in format yymmddb (optional, for nightly builds)'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -62,6 +67,7 @@ jobs:
|
|||||||
- name: Build firmware
|
- name: Build firmware
|
||||||
env:
|
env:
|
||||||
WLED_RELEASE: True
|
WLED_RELEASE: True
|
||||||
|
PLATFORMIO_BUILD_FLAGS: ${{ inputs.version && format('-D VERSION={0}', inputs.version) || '' }}
|
||||||
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
|
||||||
|
|||||||
17
.github/workflows/nightly.yml
vendored
17
.github/workflows/nightly.yml
vendored
@@ -8,8 +8,25 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
calculate_version:
|
||||||
|
name: Calculate VERSION
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
steps:
|
||||||
|
- name: Calculate VERSION
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
# VERSION format: yymmddb (b = daily build number, set to 1 for nightly)
|
||||||
|
VERSION=$(date -u +"%y%m%d")1
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Calculated VERSION: $VERSION"
|
||||||
|
|
||||||
wled_build:
|
wled_build:
|
||||||
|
needs: calculate_version
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
version: ${{ needs.calculate_version.outputs.version }}
|
||||||
nightly:
|
nightly:
|
||||||
name: Deploy nightly
|
name: Deploy nightly
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
Reference in New Issue
Block a user