This commit is contained in:
@@ -21,7 +21,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION="${GITHUB_REF_NAME#v}"
|
VERSION="${GITHUB_REF_NAME#v}"
|
||||||
echo "Building version $VERSION"
|
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
|
- name: Create Release and Upload Firmware
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
|||||||
@@ -5,8 +5,13 @@ namespace Config {
|
|||||||
// Updated by CI on every version release (see
|
// Updated by CI on every version release (see
|
||||||
// .gitea/workflows/release.yml) - shown in the info screen
|
// .gitea/workflows/release.yml) - shown in the info screen
|
||||||
// (Menu > System > Info). Locally built firmware shows "custom".
|
// (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
|
#ifdef CI_VERSION
|
||||||
constexpr const char* APP_VERSION = CI_VERSION;
|
constexpr const char* APP_VERSION = STR(CI_VERSION);
|
||||||
#else
|
#else
|
||||||
constexpr const char* APP_VERSION = "custom";
|
constexpr const char* APP_VERSION = "custom";
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user