From 63cd12b6f600db330a99061a1f20497a6997369e Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sun, 16 Aug 2026 20:35:38 +0200 Subject: [PATCH] OTA CI loop --- .gitea/workflows/release.yml | 2 +- src/config.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 3189194..eeb3774 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -21,7 +21,7 @@ jobs: run: | VERSION="${GITHUB_REF_NAME#v}" echo "Building version $VERSION" - PLATFORMIO_BUILD_FLAGS="-D CI_VERSION=\"$VERSION\"" pio run + 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 b7d391c..9b14a61 100644 --- a/src/config.h +++ b/src/config.h @@ -5,8 +5,13 @@ namespace Config { // 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". + // The STR() macro converts the raw -D define to a string literal + // (needed because PlatformIO strips quotes from build flags). +#define STR_HELPER(x) #x +#define STR(x) STR_HELPER(x) + #ifdef CI_VERSION - constexpr const char* APP_VERSION = CI_VERSION; + constexpr const char* APP_VERSION = STR(CI_VERSION); #else constexpr const char* APP_VERSION = "custom"; #endif