Skip to content

Commit

Permalink
CI Helperscript angepasst
Browse files Browse the repository at this point in the history
  • Loading branch information
shining-man committed Jul 6, 2024
1 parent 8a9caf7 commit 8d30975
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
9 changes: 5 additions & 4 deletions include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
#include "bscTime.h"


#define FW_T1 0
#define FW_T2 6
#define FW_T3 1
#define FW_MAJOR 0
#define FW_MINOR 6
#define FW_PATCH 1
#define FW_ADDITION "" // z.B.: _T1

#define BSC_SW_VERSION TOSTRING(V##FW_T1.FW_T2.FW_T3)
#define BSC_SW_VERSION TOSTRING(V##FW_MAJOR.FW_MINOR.FW_PATCH##FW_ADDITION)


static const char COMPILE_DATE_TIME[] = "";
Expand Down
22 changes: 17 additions & 5 deletions scripts/githubCI.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Copyright (c) 2024 Tobias Himmler
#
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT

import os

env_file = os.getenv('GITHUB_ENV')

fwMajor = ""
fwMinor = ""
fwPatch = ""

datei = open('./include/defines.h','r')
for zeile in datei:
Expand All @@ -17,10 +20,19 @@
defName = defs[1].strip()
defValue = defs[2].strip().replace('"', '')

if(defName == "BSC_SW_VERSION"):
defValue=defValue.lower()
print(defName+"="+defValue)
if(defName == "FW_MAJOR"):
fwMajor = defValue.lower()

if(defName == "FW_MINOR"):
fwMinor = defValue.lower()

if(defName == "FW_PATCH"):
fwPatch = defValue.lower()

if(defName == "FW_ADDITION"):
defValue = "v" + fwMajor + "." + fwMinor + "." + fwPatch + defValue.lower()
print(defName + "=" + defValue)
with open(env_file, "a") as myfile:
myfile.write(defName+"="+defValue)
myfile.write(defName + "=" + defValue)

datei.close()

0 comments on commit 8d30975

Please # to comment.