嘟嘟社区

如何下载最新版github的release ?


比如这个命令
wget https://github.com/p4gefau1t/trojan-go/releases/download/v0.5.1/trojan-go-linux-amd64.zip

0.5.1一直在变,有办法都是下载最新版吗?把0.5.1换成latest貌似不行

自己去GitHub仓库改一下链接不就好了
https://docs.github.com/en/repos … linking-to-releases
releases/latest/download/

这样就行了

  1. TAG_URL="https://api.github.com/repos/v2fly/“v-2-r-a-y”-core/releases/latest"
  2. curl -H "Accept: application/json" -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0" -s "${TAG_URL}" –connect-timeout 10| grep ‘tag_name’ | cut -d" -f4

复制代码

trojanver=`curl -L -s https://github.com/p4gefau1t/trojan-go/tags | grep tar.gz | head -1 | awk -F ‘"’ ‘{print $4}’ | awk -F ‘/’ ‘{print $7}’ | sed -e ‘[email protected]@@g’` && wget https://github.com/p4gefau1t/trojan-go/releases/download/$trojanver/trojan-go-linux-amd64.zip