diff options
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rwxr-xr-x | update.sh | 21 |
4 files changed, 28 insertions, 6 deletions
@@ -1,15 +1,15 @@ pkgbase = spotify-tui-bin pkgdesc = Spotify client for the terminal written in Rust - pkgver = v0.10.0 - pkgrel = 1 + pkgver = 0.10.0 + pkgrel = 2 url = https://github.com/Rigellute/spotify-tui arch = x86_64 license = MIT depends = openssl depends = libxcb provides = spotify-tui - source = https://github.com/Rigellute/spotify-tui/releases/download/vv0.10.0/spotify-tui-linux.tar.gz - source = https://raw.githubusercontent.com/Rigellute/spotify-tui/vv0.10.0/LICENSE + source = https://github.com/Rigellute/spotify-tui/releases/download/v0.10.0/spotify-tui-linux.tar.gz + source = https://raw.githubusercontent.com/Rigellute/spotify-tui/v0.10.0/LICENSE sha256sums = 4fd5aca58b30766bc23fa0690652a683a9fb752a958267583a36d0c417328c67 sha256sums = 76b2d30f74716c0cbd02e37868961dce2b52f65af6355864d010ee7e695d2b88 diff --git a/.gitignore b/.gitignore index a6e6c9c7a693..b59cec823b4c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ !/PKGBUILD !/.gitignore !/.SRCINFO +!/update.sh @@ -1,8 +1,8 @@ # Maintainer: Rodrigo Gryzinski <rogryza@gmail.com> pkgname='spotify-tui-bin' -pkgver=v0.10.0 -pkgrel=1 +pkgver=0.10.0 +pkgrel=2 pkgdesc="Spotify client for the terminal written in Rust" arch=('x86_64') url='https://github.com/Rigellute/spotify-tui' diff --git a/update.sh b/update.sh new file mode 100755 index 000000000000..97c5ffce1f74 --- /dev/null +++ b/update.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +echo "Fetching latest release..." +LATEST=$(hub api repos/Rigellute/spotify-tui/releases/latest | jq '.tag_name' -r) + +CURRENT=$(grep '^pkgver=' PKGBUILD | grep -oEi '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+') +if [ "$CURRENT" = "$LATEST" ]; then + echo "Package is up-to-date." +else + echo "Updating from $CURRENT to $LATEST" + sed -i 's/^pkgver=.*/pkgver='$LATEST'/' PKGBUILD + sed -i 's/^pkgrel=.*/pkgrel=1/' PKGBUILD + + updpkgsums + makepkg --printsrcinfo > .SRCINFO + + git add PKGBUILD .SRCINFO + git commit -m "Update to $LATEST" +fi |