From 21d3ba67e4a1d2c76aba777017c390cdc04bd466 Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Sun, 27 Mar 2022 01:14:22 +0100 Subject: [PATCH 1/4] version check update --- .github/workflows/build_check.yml | 1 + scripts/check_version.py | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index efa3945..1c8b2b6 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -15,6 +15,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 + - run: pip install GitPython - name: check version run: ./scripts/check_version.py diff --git a/scripts/check_version.py b/scripts/check_version.py index df9914f..5fc3f93 100755 --- a/scripts/check_version.py +++ b/scripts/check_version.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import git from datetime import date today = date.today() @@ -16,20 +17,32 @@ with open("src/LoRa_APRS_iGate.cpp") as f: version_split = version.split(".") version_year = int(version_split[0]) version_week = int(version_split[1]) +version_vers = int(version_split[2]) -print(f"firmware version year: {version_year}") -print(f"firmware version week: {version_week}") +print(f"[INFO] firmware version year: {version_year}") +print(f"[INFO] firmware version week: {version_week}") +print(f"[INFO] firmware version version: {version_vers}") +print(f"[INFO] -> {version}") -print(f"current year: {current_year}") -print(f"current week: {current_week}") +print(f"[INFO] current year: {current_year}") +print(f"[INFO] current week: {current_week}") +print(f"[INFO] -> {current_year}.{current_week}.x") error = False if version_year != current_year: - print("firmware version is not current year!") + print("[ERROR] firmware version is not current year!") error = True if version_week != current_week: - print("firmware version is not current week!") + print("[ERROR] firmware version is not current week!") error = True +repo = git.Repo('.') +if f"v{version}" in repo.tags: + print("[ERROR] tag with this version is already existing") + error = True + +if error: + print("[ERROR] check/update VERSION define in src/LoRa_APRS_iGate.cpp to fix this issue") + exit(error) From 30f69bd0392e052f98b37f8e9a97dd0ac4f5a3cb Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Sun, 27 Mar 2022 01:20:04 +0100 Subject: [PATCH 2/4] version check update --- scripts/check_version.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/check_version.py b/scripts/check_version.py index 5fc3f93..57f87ea 100755 --- a/scripts/check_version.py +++ b/scripts/check_version.py @@ -38,6 +38,7 @@ if version_week != current_week: error = True repo = git.Repo('.') +print(f"[INFO] found {len(repo.tags)} tags in repo") if f"v{version}" in repo.tags: print("[ERROR] tag with this version is already existing") error = True From 6c052d71363da52038aefead780139fdacc5943d Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Sun, 27 Mar 2022 01:24:28 +0100 Subject: [PATCH 3/4] get all tags --- .github/workflows/build_check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 1c8b2b6..65b055c 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v2 - run: pip install GitPython From 44e4f8ec4119c3c0cef85c268362d12eb961c724 Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Sun, 27 Mar 2022 01:28:33 +0100 Subject: [PATCH 4/4] version bump --- src/LoRa_APRS_iGate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 2043e7d..de4cc71 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -20,7 +20,7 @@ #include "TaskWifi.h" #include "project_configuration.h" -#define VERSION "22.12.0" +#define VERSION "22.12.1" #define MODULE_NAME "Main" String create_lat_aprs(double lat);