Skip to content

Commit

Permalink
WIP: add OS from arch parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdanilov committed Jan 29, 2025
1 parent 53e41bb commit 105026a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion hack/c8_run_versions.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

import os
import re
import requests
import json

from dataclasses import dataclass
Expand All @@ -20,6 +21,7 @@ def __dict__(self) -> dict:
return {
# "version": self.version,
"architecture": self.architecture,
# "operating_system": get_operating_system(self.architecture),
"download": self.download,
"link": self.link
}
Expand All @@ -42,6 +44,13 @@ def get_minor_version(full_version: str) -> str:
match = re.match(r"^(\d+\.\d+)\.\d+$", full_version)
return match.group(1) if match else full_version

def get_operating_system(arch: str) -> str:
if arch == 'linux':
return 'Linux'
if arch == 'windows':
return 'Windows'
if arch.startswith('darwin'):
return 'MacOS'

def fetch_github_releases(repo_owner, repo_name, token):
g = Github(token)
Expand Down
2 changes: 2 additions & 0 deletions hack/helm_chart_versions.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import csv
import re
from collections import defaultdict
Expand Down

0 comments on commit 105026a

Please sign in to comment.