Consistent version/branch info, fix gitorigin

- Dev dist: mntm-(branch)-(commit)
- Dev version: mntm-dev
- Dev gitbranch: (branch)
- Tag dist: mntm-(ver)
- Tag version: mntm-(ver)
- Tag gitbranch: mntm-(ver)
- Consistent between CI and local
- Gitorigin falls back based on context
- MNTM settings header won't clip with custom branch names
- About fw info page shows dirty flag and branch when custom, in same layout as OFW
This commit is contained in:
Willy-JL
2024-06-01 08:31:53 +01:00
parent 4be9768e10
commit cb2714ebe5
6 changed files with 65 additions and 38 deletions

View File

@@ -60,10 +60,13 @@ def get_details(event, args):
data["commit_sha"] = data["commit_hash"][:8]
data["branch_name"] = re.sub("refs/\w+/", "", ref)
data["suffix"] = (
"mntm-" + data["branch_name"].replace("/", "_") + "-" + data["commit_sha"]
"mntm-"
+ data["branch_name"].removeprefix("mntm-").replace("/", "-")
+ "-"
+ data["commit_sha"]
)
if ref.startswith("refs/tags/"):
data["suffix"] = data["branch_name"].replace("/", "_")
data["suffix"] = data["branch_name"].replace("/", "-")
return data