summarylogtreecommitdiffstats
path: root/update.sh
blob: 5d2be1cd59917e537f45bf9a5c93a7fa1a6e0f36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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