version check update

pull/175/head
Peter Buchegger 2022-03-27 01:14:22 +01:00
rodzic c52c39efea
commit 21d3ba67e4
2 zmienionych plików z 20 dodań i 6 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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)