forked from Conjure-Tools/unity-runner
added fancy tags
This commit is contained in:
parent
2c81235043
commit
58809ce20d
@ -8,6 +8,18 @@ import os
|
|||||||
import re
|
import re
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
# Define platform colors for badges
|
||||||
|
PLATFORM_COLORS = {
|
||||||
|
'android': 'brightgreen',
|
||||||
|
'webgl': 'yellow',
|
||||||
|
'ios': 'orange',
|
||||||
|
'linux (il2cpp)': 'black',
|
||||||
|
'linux (mono)': 'black',
|
||||||
|
'mac (mono)': 'white',
|
||||||
|
'mac (il2cpp)': 'white',
|
||||||
|
'windows (mono)': 'blue',
|
||||||
|
'windows (il2cpp)': 'blue'
|
||||||
|
}
|
||||||
|
|
||||||
def get_docker_hub_tags(repository, limit=1000):
|
def get_docker_hub_tags(repository, limit=1000):
|
||||||
"""
|
"""
|
||||||
@ -86,6 +98,14 @@ def get_private_registry_tags(registry, repository):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
return data.get("tags", [])
|
return data.get("tags", [])
|
||||||
|
|
||||||
|
def format_tag(registry, repository, platform, tag ):
|
||||||
|
# Get color for platform, default to blue if not found
|
||||||
|
colour = PLATFORM_COLORS.get(platform, 'blue')
|
||||||
|
safeTag = requests.utils.quote(tag.replace('-', '--'))
|
||||||
|
safePlatform = requests.utils.quote(platform)
|
||||||
|
url = requests.utils.quote(f"https://{registry}{repository}/tag/{tag}")
|
||||||
|
return f""
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
# Check for registry in environment variable if not specified in args
|
# Check for registry in environment variable if not specified in args
|
||||||
@ -135,7 +155,7 @@ def main():
|
|||||||
markdown += f"| {version} |"
|
markdown += f"| {version} |"
|
||||||
for component in all_components:
|
for component in all_components:
|
||||||
tag = versions[version].get(component, "")
|
tag = versions[version].get(component, "")
|
||||||
markdown += f" {tag} |"
|
markdown += format_tag(registry, repository, component, tag) + " |"
|
||||||
markdown += "\n"
|
markdown += "\n"
|
||||||
|
|
||||||
# Read existing README.md
|
# Read existing README.md
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user