summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo C. Gryzinski2019-12-10 10:36:47 -0300
committerRodrigo C. Gryzinski2019-12-10 10:36:47 -0300
commit90f9bf37973ffec130a6d9b454b784b6a3c8e6d0 (patch)
tree828ba903be3530c5f477cb1edf52b0290be259c6
parentbb6367e6ef3f115c33a127f69d267175f27fa4ac (diff)
downloadaur-90f9bf37973ffec130a6d9b454b784b6a3c8e6d0.tar.gz
Add update.sh and fix version
-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 ae7396327fdc..73f34dba180f 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 a6e6c9c7a693..b59cec823b4c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
!/PKGBUILD
!/.gitignore
!/.SRCINFO
+!/update.sh
diff --git a/PKGBUILD b/PKGBUILD
index ba68e6ce1583..3825e3df0fac 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 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