From 03057546e156da3e83e1308ab0b0796847065926 Mon Sep 17 00:00:00 2001 From: jLynx Date: Sat, 2 Apr 2022 22:00:46 +1300 Subject: [PATCH 1/5] WIP --- CMakeLists.txt | 4 ++-- firmware/application/ui_navigation.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf8b5706..31b9bf3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,8 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/firmware/toolchain-arm-cortex project(portapack-h1) -#set(VERSION "") -if (NOT DEFINED VERSION) +set(VERSION "$ENV{VERSION_STRING}") +if ("$ENV{EnvironmentVariableName}" STREQUAL "") execute_process( COMMAND git log -n 1 --format=%h WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index 9cc5fa87..31691134 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -212,7 +212,7 @@ namespace ui void refresh(); private: - static constexpr auto version_string = "v1.4.4"; + // static constexpr auto version_string = "v1.4.4"; NavigationView &nav_; Rectangle backdrop{ @@ -221,7 +221,7 @@ namespace ui Text version{ {2, 0, 11 * 8, 16}, - version_string}; + VERSION_STRING}; LiveDateTime ltime{ {86, 0, 19 * 8, 16}}; From 9200db24be57493576f27effbf840f95cd4f6cc6 Mon Sep 17 00:00:00 2001 From: jLynx Date: Sat, 2 Apr 2022 22:02:05 +1300 Subject: [PATCH 2/5] WIP --- CMakeLists.txt | 2 +- firmware/application/ui_navigation.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31b9bf3b..471064f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ if ("$ENV{EnvironmentVariableName}" STREQUAL "") if (GIT_VERSION_FOUND) set(VERSION "unknown") else (GIT_VERSION_FOUND) - set(VERSION "local-${GIT_VERSION}") + set(VERSION "git-${GIT_VERSION}") endif (GIT_VERSION_FOUND) endif() diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index 31691134..68723744 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -190,7 +190,7 @@ namespace ui void on_speaker(); void on_stealth(); void on_bias_tee(); - //void on_textentry(); + // void on_textentry(); void on_camera(); void on_title(); void refresh(); @@ -212,7 +212,7 @@ namespace ui void refresh(); private: - // static constexpr auto version_string = "v1.4.4"; + // static constexpr auto version_string = "v1.4.4"; // This is commented out as we are now setting the version via ENV (VERSION_STRING=v1.0.0) NavigationView &nav_; Rectangle backdrop{ From 250553e4ba76c97323c7e9b6ffabfa389b6a8449 Mon Sep 17 00:00:00 2001 From: jLynx Date: Sat, 2 Apr 2022 22:40:00 +1300 Subject: [PATCH 3/5] Updated format --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 471064f6..79ec75ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ if ("$ENV{EnvironmentVariableName}" STREQUAL "") if (GIT_VERSION_FOUND) set(VERSION "unknown") else (GIT_VERSION_FOUND) - set(VERSION "git-${GIT_VERSION}") + set(VERSION "${GIT_VERSION}") endif (GIT_VERSION_FOUND) endif() From a17eb476571a91e43aa79ceb5a15132ec6ddea7f Mon Sep 17 00:00:00 2001 From: jLynx Date: Sun, 3 Apr 2022 08:50:08 +1200 Subject: [PATCH 4/5] Fixed typo in cmake --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79ec75ad..9153ded8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/firmware/toolchain-arm-cortex project(portapack-h1) set(VERSION "$ENV{VERSION_STRING}") -if ("$ENV{EnvironmentVariableName}" STREQUAL "") +if ("$ENV{VERSION_STRING}" STREQUAL "") execute_process( COMMAND git log -n 1 --format=%h WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} From b33ef608eed50bd175ae9e53e9cd2d457c707ca8 Mon Sep 17 00:00:00 2001 From: jLynx Date: Sun, 3 Apr 2022 09:15:06 +1200 Subject: [PATCH 5/5] Updated nightly release script --- .github/workflows/create_nightly_release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create_nightly_release.yml b/.github/workflows/create_nightly_release.yml index 004720a7..99950e89 100644 --- a/.github/workflows/create_nightly_release.yml +++ b/.github/workflows/create_nightly_release.yml @@ -15,6 +15,9 @@ jobs: - name: Get current date id: date run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + - name: Get version date + id: version_date + run: echo "::set-output name=date::n_$(date +'%y%m%d')" - name: Checkout uses: actions/checkout@master with: @@ -28,7 +31,7 @@ jobs: - name: Make build folder run: mkdir ${{ github.workspace }}/build - name: Run the Docker image - run: docker run -i -v ${{ github.workspace }}:/havoc portapack-dev + run: docker run -e VERSION_STRING=${{ steps.version_date.outputs.date }} -i -v ${{ github.workspace }}:/havoc portapack-dev - name: Create Firmware ZIP run: | zip --junk-paths firmware build/firmware/portapack-h1_h2-mayhem.bin @@ -46,6 +49,7 @@ jobs: body: | **Nightly release - ${{ steps.date.outputs.date }}** This build is the latest and greatest, although may not be the most stable as this is a nightly release. + Version: ${{ steps.version_date.outputs.date }} You can find the changes in this commit ${{ github.sha }} draft: false prerelease: true