diff --git a/.github/workflows/dev-builds.yml b/.github/workflows/dev-builds.yml index 4bc468d3d19..64a14ee4d57 100644 --- a/.github/workflows/dev-builds.yml +++ b/.github/workflows/dev-builds.yml @@ -139,10 +139,12 @@ jobs: COMMIT_ID=${COMMIT_ID:-${{ github.sha }}} BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID}) VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }') - echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV - echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV + #echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV + #echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV + #echo "VERSION_TAG=-$(date '+%Y%m%d')" >> $GITHUB_ENV + echo "version=${VERSION}" >> $GITHUB_OUTPUT - name: Build SITL - run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja + run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DVERSION_TYPE="dev" -G Ninja .. && ninja - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -163,6 +165,12 @@ jobs: needs: [build, build-SITL-Linux, build-SITL-Mac, build-SITL-Windows, test] runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Get version + id: version + run: | + VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }') + echo "version=${VERSION}" >> $GITHUB_OUTPUT - name: Get current date id: date run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT @@ -196,7 +204,7 @@ jobs: - name: Upload release artifacts uses: softprops/action-gh-release@v2 with: - name: inav-dev-release-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha}} + name: inav-${{ steps.version.outputs.version }}-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }} tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }} # To create release on a different repo, we need a token setup #token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index db8ec36897b..9b5f40f3337 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,7 @@ set(COMMON_COMPILE_DEFINITIONS FC_VERSION_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR} FC_VERSION_MINOR=${CMAKE_PROJECT_VERSION_MINOR} FC_VERSION_PATCH_LEVEL=${CMAKE_PROJECT_VERSION_PATCH} + FC_VERSION_TYPE="${VERSION_TYPE}" ) if (NOT SITL) diff --git a/src/main/build/version.h b/src/main/build/version.h index 49ec81d1b11..583cdd82dd8 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -18,8 +18,12 @@ #define STR_HELPER(x) #x #define STR(x) STR_HELPER(x) #define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) +#ifndef FC_VERSION_TYPE +#define FC_VERSION_TYPE "" +#endif #define FC_FIRMWARE_NAME "INAV" + #define MW_VERSION 231 extern const char* const compilerVersion; diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index 18243fdefce..7b9c1329884 100644 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -3662,13 +3662,14 @@ static void cliStatus(char *cmdline) char buf[MAX(FORMATTED_DATE_TIME_BUFSIZE, SETTING_MAX_NAME_LENGTH)]; dateTime_t dt; - cliPrintLinef("%s/%s %s %s / %s (%s)", + cliPrintLinef("%s/%s %s %s / %s (%s) %s", FC_FIRMWARE_NAME, targetName, FC_VERSION_STRING, buildDate, buildTime, - shortGitRevision + shortGitRevision, + FC_VERSION_TYPE ); cliPrintLinef("GCC-%s", compilerVersion @@ -3906,13 +3907,14 @@ static void cliVersion(char *cmdline) { UNUSED(cmdline); - cliPrintLinef("# %s/%s %s %s / %s (%s)", + cliPrintLinef("# %s/%s %s %s / %s (%s) %s", FC_FIRMWARE_NAME, targetName, FC_VERSION_STRING, buildDate, buildTime, - shortGitRevision + shortGitRevision, + FC_VERSION_TYPE ); cliPrintLinef("# GCC-%s", compilerVersion