Using GitHub\'s Release feature, it is possible to provide a link to download a specific version of the published software. However, every time a release is made, the gh-pag
Not possible according to GitHub support as of 2018-05-23
Contacted support@github.com on 2018-05-23 with message:
Can you just confirm that there is no way besides messing with API currently?
and they replied:
Thanks for reaching out. We recommend using the API to fetch the latest release because that approach is stable, documented, and not subject to change any time soon:
https://developer.github.com/v3/repos/releases/#get-the-latest-release
I will also keep tracking this at: https://github.com/isaacs/github/issues/658
Python solution without any dependencies
Robust and portable:
#!/usr/bin/env python3
import json
import urllib.request
_json = json.loads(urllib.request.urlopen(urllib.request.Request(
'https://api.github.com/repos/cirosantilli/linux-kernel-module-cheat/releases/latest',
headers={'Accept': 'application/vnd.github.v3+json'},
)).read())
asset = _json['assets'][0]
urllib.request.urlretrieve(asset['browser_download_url'], asset['name'])
See also:
Also consider pre-releases
/latest
does not see pre-releases, but it is easy to do since /releases
shows the latest one first:
#!/usr/bin/env python3
import json
import urllib.request
_json = json.loads(urllib.request.urlopen(urllib.request.Request(
'https://api.github.com/repos/cirosantilli/linux-kernel-module-cheat/releases',
headers={'Accept': 'application/vnd.github.v3+json'},
)).read())
asset = _json[0]['assets'][0]
urllib.request.urlretrieve(asset['browser_download_url'], asset['name'])