I\'d like to have \"Download Latest Version\" button on my website which would represent the link to the latest release (stored at GitHub Releases>
If you using PHP try follow code:
function getLatestTagUrl($repository, $default = 'master') {
$file = @json_decode(@file_get_contents("https://api.github.com/repos/$repository/tags", false,
stream_context_create(['http' => ['header' => "User-Agent: Vestibulum\r\n"]])
));
return sprintf("https://github.com/$repository/archive/%s.zip", $file ? reset($file)->name : $default);
}
Function usage example
echo 'Download';