-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Sync site | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
name: Sync | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: pip install --user -r requirements.txt | ||
- name: Update metadata | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./sync.py | ||
- name: Commit and push | ||
# Do not enable branch protection for main; it'll break this. | ||
git config user.name 'CoreOS Bot' | ||
git config user.email [email protected] | ||
git add docs/data/* | ||
git commit -m "Update data 📦" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/docs/.jekyll-cache/ | ||
/docs/_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Latest releases | ||
|
||
This is a [small dashboard](https://coreos.github.io/latest-releases/) that | ||
tracks the freshness of the latest releases of various CoreOS upstream | ||
projects. The site is hosted in GitHub Pages and updated daily by a GitHub | ||
Actions job. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
thresholds: | ||
# days | ||
green: 60 | ||
yellow: 180 | ||
|
||
groups: | ||
- name: Distro components | ||
repos: | ||
- coreos/afterburn | ||
- coreos/bootupd | ||
- coreos/console-login-helper-messages | ||
- coreos/coreos-installer | ||
- coreos/ignition | ||
- coreos/rpm-ostree | ||
- coreos/ssh-key-dir | ||
- coreos/toolbox | ||
- coreos/zincati | ||
- ostreedev/ostree | ||
|
||
- name: Utilities | ||
repos: | ||
- coreos/butane | ||
|
||
- name: Libraries | ||
repos: | ||
- coreos/cap-std-ext | ||
- coreos/go-json | ||
- coreos/go-semver | ||
- coreos/go-systemd | ||
- coreos/ign-converter | ||
- coreos/ignition-config-rs | ||
- coreos/openat-ext | ||
- coreos/openssh-keys | ||
- coreos/stream-metadata-go | ||
- coreos/stream-metadata-rust | ||
- ostreedev/ostree-rs-ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!doctype html> | ||
<title>{{ page.title }}</title> | ||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> | ||
|
||
<style> | ||
html { | ||
margin: .6em; | ||
} | ||
table { | ||
border-collapse: collapse; | ||
} | ||
td { | ||
padding: .2em .5em; | ||
} | ||
tbody tr:nth-child(odd) { | ||
background-color: #e8e8e8; | ||
} | ||
#source { | ||
float: right; | ||
margin: .6em; | ||
} | ||
</style> | ||
|
||
<div id=source> | ||
<a href="https://github.com/coreos/latest-releases/">source</a> | ||
</div> | ||
|
||
{{ content }} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
layout: default | ||
title: Latest CoreOS upstream releases | ||
--- | ||
|
||
# Latest CoreOS upstream releases | ||
|
||
{% for group in site.data.repos.groups %} | ||
### {{ group.name }} | ||
|
||
| Repository | Current release | Release date | Commits since release (non-trivial / all) | | ||
| --- | --- | --- | --- | | ||
{% for repo in group.repos %}| [{{ repo.repo }}]({{ repo.url }}) | [{{ repo.release }}]({{ repo.release_url }}) | {% if repo.release_days < site.data.repos.green_thresh %}🟢{% elsif repo.release_days < site.data.repos.yellow_thresh %}🟨{% else %}🛑{% endif %} {{ repo.release_date }} ({{ repo.release_days }} days ago) | {{ repo.compare_nontrivial }} / [{{ repo.compare_commits }}]({{ repo.compare_url }}) | | ||
{% endfor %} | ||
{% endfor %} | ||
|
||
Last updated: {{ site.data.repos.updated }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github3.py | ||
PyYAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/python3 | ||
|
||
from datetime import datetime, timezone | ||
import github3 | ||
import os | ||
import re | ||
import sys | ||
import yaml | ||
|
||
def main(): | ||
with open('config.yml') as fh: | ||
conf = yaml.safe_load(fh) | ||
|
||
token = os.getenv('GITHUB_TOKEN') | ||
assert token | ||
g = github3.login(token=token) | ||
|
||
groups = [] | ||
for group in conf['groups']: | ||
repos = [] | ||
groups.append({ | ||
'name': group['name'], | ||
'repos': repos, | ||
}) | ||
|
||
for desc in group['repos']: | ||
owner, name = desc.split('/') | ||
repo = g.repository(owner=owner, repository=name) | ||
|
||
try: | ||
release = repo.latest_release() | ||
except github3.exceptions.NotFoundError: | ||
print( | ||
f"No releases (tags don't count): {desc}", | ||
file=sys.stderr | ||
) | ||
continue | ||
delta = datetime.now(timezone.utc) - release.published_at | ||
|
||
compare = repo.compare_commits( | ||
release.tag_name, repo.default_branch | ||
) | ||
nontrivial_commits = len([ | ||
c for c in compare.commits | ||
# not merge commit | ||
if len(c.parents) == 1 and | ||
# not by Dependabot | ||
(c.author is None or c.author.login != 'dependabot[bot]') | ||
]) | ||
|
||
repos.append({ | ||
'repo': desc, | ||
'url': repo.html_url, | ||
'release': re.sub('^[a-z-]+', '', release.tag_name), | ||
'release_url': release.html_url, | ||
'release_date': release.published_at.strftime("%Y-%m-%d"), | ||
'release_days': int(delta.total_seconds() / 86400), | ||
'compare_commits': compare.ahead_by, | ||
'compare_nontrivial': nontrivial_commits, | ||
'compare_url': compare.html_url, | ||
}) | ||
|
||
with open('docs/_data/repos.yml', 'w') as fh: | ||
yaml.dump({ | ||
'groups': groups, | ||
'updated': datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S"), | ||
'green_thresh': conf['thresholds']['green'], | ||
'yellow_thresh': conf['thresholds']['yellow'], | ||
}, fh) | ||
|
||
if __name__ == '__main__': | ||
main() |