summarylogtreecommitdiffstats
path: root/release.sh
blob: fd2e06903093d20dca5d9d2887a0ecb16d9ee6a9 (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
#!/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 -f midica-*.jar
rm -f midica-*.zst

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

echo == Downloading source to compute SHA256...
makepkg --verifysource --skipchecksums
SHA256=$(sha256sum midica-${VERSION}.jar | 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