summarylogtreecommitdiffstats
path: root/update.sh
blob: 605f82e1b0568470baedfb0dd2ff11c2497a6cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

set -e

UPSTREAM=${UPSTREAM:-newrelic/infrastructure-agent}
echo "Using ${UPSTREAM} as upstream repo"

if [[ -z $VERSION ]]; then
	VERSION=$(curl -s https://api.github.com/repos/newrelic/infrastructure-agent/releases/latest | jq -r .tag_name)
fi

echo "Updating PKGBUILD to ${VERSION}"
sed -i "s/pkgver=.*/pkgver=${VERSION}/" PKGBUILD

echo "Updating checksums..."
updpkgsums

echo "Checking build..."
makepkg -s

echo "Updating .SRCINFO..."
makepkg --printsrcinfo > .SRCINFO

echo "Successfully updated PKGBUILD to $VERSION"