Compare Versions #10
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
name: Compare Versions | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '02 8 * * *' | |
jobs: | |
Compare-Versions: | |
runs-on : ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
name : Compare Versions | |
steps : | |
- uses: actions/checkout@v4 | |
name: Checkout | |
- name: Cache OpenAF runtime | |
uses: actions/cache@v3 | |
with: | |
key : oaf-t8 | |
path: /tmp/oaf | |
- name: Setup OpenAF | |
uses: openaf/action-setup@v2 | |
with: | |
dist: t8 | |
- name: Retrieving the latest version of the used tools to /tmp/_tmpMain.json | |
run : | | |
cat <<_EOF_ | oafp in=yaml out=json | oafp in=oafp out=json > /tmp/_tmpMain.json | |
# Skopeo | |
- url : https://api.github.com/repos/containers/skopeo/releases/latest | |
path: "{tool:'skopeo',lastVer:tag_name}" | |
# OpenAF | |
- url : https://openaf.io/release | |
in : raw | |
path: "{tool:'oaf',lastVer:@}" | |
# Helm | |
- url : https://api.github.com/repos/helm/helm/releases/latest | |
path: "{tool:'helm',lastVer:tag_name}" | |
# Docker | |
- url : https://api.github.com/repos/docker/cli/tags | |
path: "[0].{tool:'docker',lastVer:name}" | |
# CriCtl | |
- url : https://api.github.com/repos/kubernetes-sigs/cri-tools/releases/latest | |
path: "{tool:'crictl',lastVer:name}" | |
# Ctr | |
- url : https://api.github.com/repos/containerd/containerd/releases/latest | |
path: "{tool:'ctr',lastVer:name}" | |
# NerdCtl | |
- url : https://api.github.com/repos/containerd/nerdctl/releases/latest | |
path: "{tool:'nerdctl',lastVer:name}" | |
# Midnight Commander | |
- url : https://api.github.com/repos/MidnightCommander/mc/tags | |
path: "[0].{tool:'mc',lastVer:name}" | |
# Syft | |
- url : https://api.github.com/repos/anchore/syft/releases/latest | |
path: "{tool:'syft',lastVer:name}" | |
_EOF_ | |
oafp /tmp/_tmpMain.json out=ctable | |
- name: Preparing a lookup table for the build versions of the tools | |
run : | | |
oafp .github/build-versions.json out=ch ch="(type: file, options: (file: /tmp/_tmp.json))" chkey="tool" path=versions | |
oafp /tmp/_tmp.json | |
- name: Preparing a lookup table for the latest versions of the tools | |
run : | | |
oafp .github/latest-versions.json out=ch ch="(type: file, options: (file: /tmp/_tmpl.json))" chkey="tool" path=versions | |
oafp /tmp/_tmpl.json | |
- name: Joining the versions retrieved to produce a markdown table | |
run : | | |
oafp chs="[(name: v, type: file, options: (file: /tmp/_tmp.json))|(name: l, type: file, options: (file: /tmp/_tmpl.json))]"\ | |
/tmp/_tmpMain.json\ | |
path="[].{tool:tool,latestOnline:lastVer,buildVersion:ch('v','get',{tool:tool},__).version,latestversion:ch('l','get',{tool:tool},__).version}"\ | |
out=mdtable\ | |
sql="select * where tool <> 'mc' order by tool" > .github/compare-versions.md | |
- uses: openaf/ojob-action@v7 | |
name: Update table | |
env : | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
ojob: 'ojob.io/git/hub/contentIn' | |
args: 'message="update\ versions\ table\ {{date}}/{{time}}" title="Update\ table" paths=.github/' | |
dist: t8 |