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
|
- cron: '0 0 * * *' # Run daily at midnight
|
||||||
workflow_dispatch: # Allow manual triggering
|
workflow_dispatch: # Allow manual triggering
|
||||||
workflow_run: # Trigger from images
|
workflow_run: # Trigger from images
|
||||||
workflows:
|
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- scripts/update-readme.py
|
||||||
|
- .gitea/workflows/update-readme.py
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-readme:
|
update-readme:
|
||||||
|
|||||||
@ -1,25 +1,9 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import argparse
|
|
||||||
import requests
|
import requests
|
||||||
import json
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import re
|
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):
|
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 ):
|
def format_tag(registry, repository, platform, tag ):
|
||||||
# Get color for platform, default to blue if not found
|
# Get color for platform, default to blue if not found
|
||||||
colour = PLATFORM_COLORS.get(platform, 'blue')
|
registryName = "Docker Hub"
|
||||||
safeTag = requests.utils.quote(tag.replace('-', '--'))
|
url = f"https://hub.docker.com/r/{repository}/tags?name={tag}"
|
||||||
safePlatform = requests.utils.quote(platform)
|
|
||||||
url = requests.utils.quote(f"https://{registry}{repository}/tag/{tag}")
|
if registry:
|
||||||
return f""
|
registryName = registry
|
||||||
|
url = f"https://{registry}{repository}/tag/{tag}"
|
||||||
|
|
||||||
|
return f"[{registryName}]({url})"
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
@ -155,7 +142,10 @@ 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, "")
|
||||||
|
if tag:
|
||||||
markdown += format_tag(registry, repository, component, tag) + " |"
|
markdown += format_tag(registry, repository, component, tag) + " |"
|
||||||
|
else:
|
||||||
|
markdown += "❌ |"
|
||||||
markdown += "\n"
|
markdown += "\n"
|
||||||
|
|
||||||
# Read existing README.md
|
# Read existing README.md
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user