Skip to content

Instantly share code, notes, and snippets.

@zhanglianxin
Last active August 28, 2020 18:43
Show Gist options
  • Save zhanglianxin/06c371b528ec52315ce93d9c9b1d9401 to your computer and use it in GitHub Desktop.
Save zhanglianxin/06c371b528ec52315ce93d9c9b1d9401 to your computer and use it in GitHub Desktop.
Get latest release tag from repo releases page.
#!/bin/bash
RELEASES=https://github.com/zhanglianxin/qrc/releases
FILENAME='qrc_linux_amd64"'
RELEASE_TAG=$(wget -qO - "$RELEASES" | grep "$FILENAME" | head -1 | awk -F / '{print $6}')
echo $RELEASE_TAG
@zhanglianxin
Copy link
Author

zhanglianxin commented Aug 28, 2020

e.g.

#!/bin/bash

RELEASES=https://github.com/shadowsocks/shadowsocks-libev/releases
FILENAME=shadowsocks-libev-.*\.tar\.gz\" # regex
# OR
# FILENAME='shadowsocks-libev-.*.tar.gz"' # regex

RELEASE_TAG=$(wget -qO - "$RELEASES" | grep "$FILENAME" | head -1 | awk  -F / '{print $6}')
echo $RELEASE_TAG # v3.3.4

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