Hi,
In this thread I was trying to find the latest release version to scrape so a script could tell me if it was time for an upgrade by scraping https://raw.githubusercontent.com/osmc/osmc/master/package/base-files-osmc/files/etc/os-release
I’m trying to find somewhere to capture the latest version released via bash script
So I can then compare it to
grep VERSION_ID /etc/os-release
Github api seems the obvious place but I’m note sure if my query is incorrect or it’s got something to do with the latest release being marked differently
curl -s https://api.github.com/repos/osmc/osmc/releases/latest
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3/repos/releases/#get-the-latest-release"
}
compare…
This is now showing v 2021.07-1 but I don’t think that’s released yet (?).
Can someone help with a better way please?
In other projects I could call https://api.github.com/repos/osmc/osmc/releases/latest
but this doesn’t seem to work for OSMC, just points to the api help but the script there doesn’t help either?
Is there something specific about your releases that work differntly, apologies - not that au fait with github.
Well that file I think would be changed shortly before a release is public. I know that Sam said mid July release, and I’m personally surprised that it wasn’t pushed yesterday(a Sunday releases seems to be a thing for Sam). I bet the release of v.19 is coming real soon.
Thanks and suspected the same.
If it’s a one off time it’s not a problem but don’t understand how the releases work on github, kind of interested now.
Should the API method work? Why doesn’t it for osmc I wonder?
What’s key my side if that my script let’s me know when there’s a new release out.
I held things back a bit so @Chillbo has a chance to get some changes in and we have a chance to get more translations in.
I always tag a release on GitHub when we push – so you could almost certainly monitor that programatically
Sam
Thanks Sam, know you’re busy so apologies for asking…
“I always tag a release on GitHub” - where am I looking for that please? Githhub versioning confused me a little
A quick & dirty solution might be:
curl -Lsf https://api.github.com/repos/osmc/osmc/tags | grep name | head -1
Edit: or even bettercurl -Lsf https://api.github.com/repos/osmc/osmc/tags | jq -r '.[0].name'
For completeness:
If a project creates a “release” additional to a tag (which OSMC doesn’t), you could also use:
https://api.github.com/repos/USER/REPO/releases/latest
1 Like
Quick and dirty are my middle names, perfect, thanks for taking the time to look for me.