mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-03 17:56:12 -04:00
chore: small tool to check latest library versions
This commit is contained in:
parent
a622d89f9c
commit
cd36d98fc7
45
.docker/check_lib_versions.py
Executable file
45
.docker/check_lib_versions.py
Executable file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
import requests
|
||||
|
||||
# List of GitHub repositories in 'author/project' format
|
||||
repositories = [
|
||||
"libarchive/libarchive",
|
||||
"xiph/flac",
|
||||
"libunwind/libunwind",
|
||||
"google/benchmark",
|
||||
"openssl/openssl",
|
||||
"jeremy-rifkin/cpptrace",
|
||||
"google/double-conversion",
|
||||
"fmtlib/fmt",
|
||||
"google/glog",
|
||||
"Cyan4973/xxHash",
|
||||
"lz4/lz4",
|
||||
"google/brotli",
|
||||
"facebook/zstd",
|
||||
"libfuse/libfuse",
|
||||
]
|
||||
|
||||
# Function to fetch the latest release information for a repository
|
||||
def get_latest_release(repo):
|
||||
url = f"https://api.github.com/repos/{repo}/releases/latest"
|
||||
response = requests.get(url)
|
||||
|
||||
if response.status_code == 200:
|
||||
release = response.json()
|
||||
tag_name = release['tag_name']
|
||||
release_date = release['published_at']
|
||||
return tag_name, release_date
|
||||
else:
|
||||
print(f"Failed to fetch data for {repo}")
|
||||
return None, None
|
||||
|
||||
# Fetch the latest release information for each repository
|
||||
for repo in repositories:
|
||||
version, release_date = get_latest_release(repo)
|
||||
if version and release_date:
|
||||
[author, project] = repo.split('/')
|
||||
date = release_date.split('T')[0]
|
||||
version = version.replace(f"{project}-", "").lstrip('v')
|
||||
project = project.replace('-', '_').upper()
|
||||
version_var = f"{project}_VERSION={version}"
|
||||
print(f"{version_var:<40} # {date}")
|
Loading…
x
Reference in New Issue
Block a user