Commit ab80533a authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers 🐦

utility to check for new releases

parent 1685be65
#! /usr/bin/env python3
# A small utility to check for new project releases that need packaging
import os
import logging
from github import Github
from github.GithubException import UnknownObjectException
LAST_PACKAGED = { "emersion/slurp": "1.2.0", "emersion/grim": "1.2.0", "swaywm/wlroots": "1.2.0", "swaywm/sway": "1.2.0", "ammen99/wf-recorder": "0.0.1", "bugaevc/wl-clipboard": "1.0.0" }
# for all projects fetch the latest version and download urls
def get_releases(api_key=None):
if not api_key:
api_key = os.environ['GITHUB_API_KEY']
g = Github(api_key)
last_releases = {}
for (project, packaged_version) in LAST_PACKAGED.items():
repo = g.get_repo(project)
release = repo.get_latest_release()
release_version = release.tag_name
last_releases[project] = release_version
if release.tag_name != "v"+packaged_version:
logging.warning("project %s (release %s) doesn't match packaged version (%s)", project, release_version, packaged_version)
except UnknownObjectException as e:
logging.warning("project %s has no releases, cannot check version infomation", project)
return last_releases
if __name__ == '__main__':
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment