-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set version number using Actions (#68)
- Loading branch information
Showing
5 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
#pragma once | ||
#include <lvgl.h> | ||
#include "screens/screens.h" | ||
|
||
#ifndef VERSION | ||
#define STRINGIZER(arg) #arg | ||
#define STR_VALUE(arg) STRINGIZER(arg) | ||
#define VERSION STR_VALUE(BUILD_VERSION) | ||
#endif | ||
void ui_init(); | ||
extern void globalEventHandler(lv_event_t *e); | ||
extern void globalEventHandler(lv_event_t *e); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# source from https://github.com/MobiFlight/MobiFlight-FirmwareSource/blob/main/get_version.py | ||
|
||
Import("env") | ||
import os | ||
|
||
# Get the version number from the build environment. | ||
version = os.environ.get('VERSION', "") | ||
|
||
# Clean up the version number | ||
if version == "": | ||
# When no version is specified default to "0.0.1" | ||
version = "0.0.1" | ||
|
||
# Strip any leading "v" that might be on the version and | ||
# any leading or trailing periods. | ||
version = version.lstrip("v") | ||
version = version.strip(".") | ||
|
||
print(f'Using version {version} for the build') | ||
|
||
# Append the version to the build defines so it gets baked into the firmware | ||
env.Append(CPPDEFINES=[ | ||
f'BUILD_VERSION={version}' | ||
]) |