Skip to content

Commit f41dd60

Browse files
committed
Fix version type definition
1 parent 01df8f7 commit f41dd60

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

.github/workflows/dev-builds.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ jobs:
139139
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
140140
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
141141
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
142-
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
143-
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
142+
#echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
143+
#echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
144+
#echo "VERSION_TAG=-$(date '+%Y%m%d')" >> $GITHUB_ENV
145+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
144146
- name: Build SITL
145-
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja
147+
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DVERSION_TYPE="dev" -G Ninja .. && ninja
146148
- name: Upload artifacts
147149
uses: actions/upload-artifact@v4
148150
with:
@@ -163,6 +165,12 @@ jobs:
163165
needs: [build, build-SITL-Linux, build-SITL-Mac, build-SITL-Windows, test]
164166
runs-on: ubuntu-latest
165167
steps:
168+
- uses: actions/checkout@v4
169+
- name: Get version
170+
id: version
171+
run: |
172+
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
173+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
166174
- name: Get current date
167175
id: date
168176
run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
@@ -196,7 +204,7 @@ jobs:
196204
- name: Upload release artifacts
197205
uses: softprops/action-gh-release@v2
198206
with:
199-
name: inav-dev-release-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha}}
207+
name: inav-${{ steps.version.outputs.version }}-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }}
200208
tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
201209
# To create release on a different repo, we need a token setup
202210
#token: ${{ secrets.GITHUB_TOKEN }}

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ set(COMMON_COMPILE_DEFINITIONS
7979
FC_VERSION_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR}
8080
FC_VERSION_MINOR=${CMAKE_PROJECT_VERSION_MINOR}
8181
FC_VERSION_PATCH_LEVEL=${CMAKE_PROJECT_VERSION_PATCH}
82+
FC_VERSION_TYPE="${VERSION_TYPE}"
8283
)
8384

8485
if (NOT SITL)

src/main/build/version.h

+4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
#define STR_HELPER(x) #x
1919
#define STR(x) STR_HELPER(x)
2020
#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL)
21+
#ifndef FC_VERSION_TYPE
22+
#define FC_VERSION_TYPE ""
23+
#endif
2124
#define FC_FIRMWARE_NAME "INAV"
2225

26+
2327
#define MW_VERSION 231
2428

2529
extern const char* const compilerVersion;

src/main/fc/cli.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -3662,13 +3662,14 @@ static void cliStatus(char *cmdline)
36623662
char buf[MAX(FORMATTED_DATE_TIME_BUFSIZE, SETTING_MAX_NAME_LENGTH)];
36633663
dateTime_t dt;
36643664

3665-
cliPrintLinef("%s/%s %s %s / %s (%s)",
3665+
cliPrintLinef("%s/%s %s %s / %s (%s) %s",
36663666
FC_FIRMWARE_NAME,
36673667
targetName,
36683668
FC_VERSION_STRING,
36693669
buildDate,
36703670
buildTime,
3671-
shortGitRevision
3671+
shortGitRevision,
3672+
FC_VERSION_TYPE
36723673
);
36733674
cliPrintLinef("GCC-%s",
36743675
compilerVersion
@@ -3906,13 +3907,14 @@ static void cliVersion(char *cmdline)
39063907
{
39073908
UNUSED(cmdline);
39083909

3909-
cliPrintLinef("# %s/%s %s %s / %s (%s)",
3910+
cliPrintLinef("# %s/%s %s %s / %s (%s) %s",
39103911
FC_FIRMWARE_NAME,
39113912
targetName,
39123913
FC_VERSION_STRING,
39133914
buildDate,
39143915
buildTime,
3915-
shortGitRevision
3916+
shortGitRevision,
3917+
FC_VERSION_TYPE
39163918
);
39173919
cliPrintLinef("# GCC-%s",
39183920
compilerVersion

0 commit comments

Comments
 (0)