Last active
December 18, 2015 10:20
-
-
Save FrozenCow/335f394780cbfe26fca1 to your computer and use it in GitHub Desktop.
Update PKGBUILD with new pkgver based on Github releases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -o errexit | |
source ./PKGBUILD | |
OLDVERSION="$pkgver" | |
NEWVERSION=$(curl -sS https://api.github.com/repos/itchio/itch/releases | jq -r '.[0].tag_name | match("^v(\\d+(\\.\\d+)+)$"; "g").captures[0].string') | |
echo "previous version: $OLDVERSION" | |
echo "latest version: $NEWVERSION" | |
if [ "$OLDVERSION" = "$NEWVERSION" ] | |
then | |
echo "no update available" | |
exit 1 | |
fi | |
sed -i "s/pkgver=.*/pkgver=$NEWVERSION/g" PKGBUILD | |
updpkgsums | |
namcap -i PKGBUILD | |
makepkg -s -f | |
namcap "$pkgname-$pkgver-$pkgrel-$(uname -m).pkg.tar.xz" | |
mksrcinfo | |
git add PKGBUILD .SRCINFO | |
git commit -m "$OLDVERSION -> $NEWVERSION" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment