forked from Conjure-Tools/unity-runner
updated readme generation
This commit is contained in:
parent
605772a093
commit
19d9030c3c
@ -5,9 +5,12 @@ on:
|
||||
- cron: '0 0 * * *' # Run daily at midnight
|
||||
workflow_dispatch: # Allow manual triggering
|
||||
workflow_run: # Trigger from images
|
||||
workflows:
|
||||
types:
|
||||
- completed
|
||||
push:
|
||||
paths:
|
||||
- scripts/update-readme.py
|
||||
- .gitea/workflows/update-readme.py
|
||||
|
||||
jobs:
|
||||
update-readme:
|
||||
|
||||
@ -1,25 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import requests
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
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):
|
||||
"""
|
||||
@ -100,11 +84,14 @@ def get_private_registry_tags(registry, repository):
|
||||
|
||||
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""
|
||||
registryName = "Docker Hub"
|
||||
url = f"https://hub.docker.com/r/{repository}/tags?name={tag}"
|
||||
|
||||
if registry:
|
||||
registryName = registry
|
||||
url = f"https://{registry}{repository}/tag/{tag}"
|
||||
|
||||
return f"[{registryName}]({url})"
|
||||
|
||||
def main():
|
||||
|
||||
@ -155,7 +142,10 @@ def main():
|
||||
markdown += f"| {version} |"
|
||||
for component in all_components:
|
||||
tag = versions[version].get(component, "")
|
||||
if tag:
|
||||
markdown += format_tag(registry, repository, component, tag) + " |"
|
||||
else:
|
||||
markdown += "❌ |"
|
||||
markdown += "\n"
|
||||
|
||||
# Read existing README.md
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user