Skip to content

Instantly share code, notes, and snippets.

@thanoskoutr
Last active August 25, 2022 14:46
Show Gist options
  • Save thanoskoutr/94d6aba2b6c568381d2d11fee0a821bf to your computer and use it in GitHub Desktop.
Save thanoskoutr/94d6aba2b6c568381d2d11fee0a821bf to your computer and use it in GitHub Desktop.
Download Latest Release from GitHub

About

Download the latest release of a project for your architecture from any project on GitHub. The only thing you need to know is the project's name, owner and the naming convention for the releases.

For example, to download the latest version of chroma for a Linux 64-bit system:

$ TAG=$(curl -sS https://api.github.com/repos/alecthomas/chroma/releases/latest | jq -r '.tag_name')
$ curl -OL "https://github.com/alecthomas/chroma/releases/download/${TAG}/chroma-${TAG:1}-linux-amd64.tar.gz"

Another example, to download the latest version of protobuf for a Windows 64-bit system:

$ TAG=$(curl -sS https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | jq -r '.tag_name')
$ curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/${TAG}/protoc-${TAG:1}-win64.zip"

Another example, to download the latest version of grpcurl for any operating system:

$ TAG=$(curl -sS https://api.github.com/repos/fullstorydev/grpcurl/releases/latest | jq -r '.tag_name')
$ curl -OL "https://github.com/fullstorydev/grpcurl/releases/download/${TAG}/grpcurl_${TAG:1}_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m).tar.gz"

Dependencies

  • tr
  • curl
  • jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment