summarylogtreecommitdiffstats
path: root/release
blob: 646324bf098d93282b1e08af06785f8171b259ef (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

VERSION="$1"

if [ -z "$VERSION" ]
then
	echo Please provide version number as first argument to the script
	exit 1
fi

echo == Cleaning up things...
rm -rf pkg
rm -rf src
rm -f owntracks-recorder-*.tar.gz
rm -f owntracks-recorder-*.zst

echo == Changing pkgver in PKGBUILD...
sed -i "s/^pkgver=.*$/pkgver=$VERSION/" PKGBUILD

echo == Downloading source to compute SHA256...
touch install.sh # Need to do this in case it doesn't exist
makepkg --verifysource --skipchecksums
SHA256=$(sha256sum owntracks-recorder-${VERSION}.tar.gz | awk '{print $1}')
echo SHA256=$SHA256

echo == Changing sha256sums in PKGBUILD...
sed -i "s/^sha256sums=.*$/sha256sums=\(\"${SHA256}\"\)/" PKGBUILD

echo == Checking package build...
if ! makepkg -frs
then
	echo
	echo "PACKAGE BUILD FAILED !!!"
	echo
	exit 1
fi

echo == Generating .SRCINFO file...
makepkg --printsrcinfo > .SRCINFO

echo == Creating release commit...
git add .
git commit -m "release $VERSION"

echo
echo The release commit is ready.
echo Please check that it is correct, then run 'git push' when ready
echo