summarylogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
authorThiago Almeida2022-02-10 18:51:06 +0100
committerThiago Almeida2022-02-10 18:51:06 +0100
commited4c682411bab4ac1dfe60f00afbee0a1775a347 (patch)
treea00eba1897d4ab87fd0d294297afb581d7f3e11d /update.sh
downloadaur-ed4c682411bab4ac1dfe60f00afbee0a1775a347.tar.gz
Initial commit
Releasing version 0.1.2
Diffstat (limited to 'update.sh')
-rw-r--r--update.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100644
index 000000000000..5d2be1cd5991
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -x
+
+set -eo pipefail
+
+rm -rf pkg src pluralith-cli-bin pluralith-cli-bin-0.1.1-1-x86_64.pkg.tar.zst || true
+
+[[ -n "$GITHUB_TOKEN" ]] && GITHUB_AUTH="Authorization: ${GITHUB_TOKEN}" || GITHUB_AUTH=""
+
+LATEST_RELEASE_INFO=$(http https://api.github.com/repos/Pluralith/pluralith-cli/releases/latest \
+ "Accept: application/vnd.github.v3+json" ${GITHUB_AUTH})
+
+pkgver=$(jq -r .name <<< "${LATEST_RELEASE_INFO}")
+
+sed -i -r 's/(pkgver=).*/\1'"${pkgver#v}"'/g' PKGBUILD
+
+updpkgsums
+
+makepkg --printsrcinfo --clean >.SRCINFO