Skip to content

Commit

Permalink
Merge pull request #175 from lora-aprs/update_version_check
Browse files Browse the repository at this point in the history
version check update
  • Loading branch information
peterus authored Mar 27, 2022
2 parents c52c39e + 44e4f8e commit d7aa926
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ 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
- name: check version
run: ./scripts/check_version.py

Expand Down
26 changes: 20 additions & 6 deletions scripts/check_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

import git
from datetime import date

today = date.today()
Expand All @@ -16,20 +17,33 @@
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('.')
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

if error:
print("[ERROR] check/update VERSION define in src/LoRa_APRS_iGate.cpp to fix this issue")

exit(error)
2 changes: 1 addition & 1 deletion src/LoRa_APRS_iGate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d7aa926

Please sign in to comment.