From 6a798f8a89b87d9b14267f6c856302189db5169f Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sun, 16 Aug 2026 20:27:14 +0200 Subject: [PATCH] CI for OTA update --- .gitea/workflows/release.yml | 5 ++++- src/config.h | 13 ++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index fc1f000..3189194 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -18,7 +18,10 @@ jobs: run: pip install platformio - name: Build firmware - run: pio run + run: | + VERSION="${GITHUB_REF_NAME#v}" + echo "Building version $VERSION" + PLATFORMIO_BUILD_FLAGS="-D CI_VERSION=\"$VERSION\"" pio run - name: Create Release and Upload Firmware uses: softprops/action-gh-release@v2 diff --git a/src/config.h b/src/config.h index 59f5f96..b7d391c 100644 --- a/src/config.h +++ b/src/config.h @@ -2,11 +2,14 @@ #include namespace Config { -// Updated by Karl on every version release (see - // CLAUDE.md workflow "Standard Workflow: Push & Release") - shown - // in the info screen (Menu > System > Info) and must match the - // corresponding Git tag. - constexpr const char* APP_VERSION = "3.6.3"; +// Updated by CI on every version release (see + // .gitea/workflows/release.yml) - shown in the info screen + // (Menu > System > Info). Locally built firmware shows "custom". +#ifdef CI_VERSION + constexpr const char* APP_VERSION = CI_VERSION; +#else + constexpr const char* APP_VERSION = "custom"; +#endif // Display brightness (Menu > System > Brightness), in percent. // MIN intentionally not 0 - a completely dark display could otherwise