-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·25 lines (19 loc) · 973 Bytes
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set -e
##export tag=${{steps.fetch-latest-release.tag_name}}
export ver=$(echo $tag | cut -d - -f 1)
export tagdate=$(echo $tag | cut -d - -f 3)
export pkgver=${ver#v}.$tagdate
sed -i -r s/^pkgver=.+/pkgver=$pkgver/ PKGBUILD
if [[ -n $(git status --porcelain) ]]; then
## pkgver changed
export sha256sum=$(curl -L https://github.com/GreptimeTeam/greptimedb/releases/download/${tag}/greptime-linux-amd64-${tag}.sha256sum)
sed -i -r s/^pkgrel=.+/pkgrel=1/ PKGBUILD
sed -i -r s/^_pkgvergh=.+/_pkgvergh=$tag/ PKGBUILD
sed -i -r s/^sha256sums=.+/sha256sums=\(\"$sha256sum\"/ PKGBUILD
sed -i -r s/pkgver.+/pkgver\ =\ $pkgver/ .SRCINFO
sed -i -r s/pkgrel.+/pkgrel\ =\ 1/ .SRCINFO
sed -i -r s/download\\/.+\\//download\\/$tag\\// .SRCINFO
sed -i -r s/greptime-linux-amd64-.+\\.tar\\.gz/greptime-linux-amd64-$tag.tar.gz/ .SRCINFO
sed -i -r 0,/sha256sums.+/s//sha256sums\ =\ $sha256sum/ .SRCINFO
echo "dirty=yes" >>$GITHUB_OUTPUT
fi