summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO8
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD4
-rwxr-xr-xupdate.sh21
4 files changed, 28 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ae7396327fd..73f34dba180 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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 a6e6c9c7a69..b59cec823b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
!/PKGBUILD
!/.gitignore
!/.SRCINFO
+!/update.sh
diff --git a/PKGBUILD b/PKGBUILD
index ba68e6ce158..3825e3df0fa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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 00000000000..97c5ffce1f7
--- /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