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
As noted previously, jq is useful for this and other REST APIs.
Assuming you want the macOS release:
URL=$( curl -s "https://api.github.com/repos/atom/atom/releases/latest" \
| jq -r '.assets[] | select(.name=="atom-mac.zip") | .browser_download_url' )
curl -LO "$URL"
Note each repo can have different ways of providing the desired artifact, so I will demonstrate for a well-behaved one like atom.
curl -s "https://api.github.com/repos/atom/atom/releases/latest" \
| jq -r '.assets[] | .name'
atom-1.15.0-delta.nupkg
atom-1.15.0-full.nupkg
atom-amd64.deb
...
Below atom-mac is my desired asset via jq's select(.name=="atom-mac.zip")
curl -s "https://api.github.com/repos/atom/atom/releases/latest" \
| jq -r '.assets[] | select(.name=="atom-mac.zip") | .browser_download_url'
https://github.com/atom/atom/releases/download/v1.15.0/atom-mac.zip
curl -LO "https://github.com/atom/atom/releases/download/v1.15.0/atom-mac.zip"
jq syntax can be difficult. Here's a playground for experimenting with the jq above:
https://jqplay.org/s/h6_LfoEHLZ
You should take measures to ensure the validity of the downloaded artifact via sha256sum and gpg, if at all possible.