summarylogtreecommitdiffstats
path: root/release.sh
blob: 92c25076883f2b16a4d57142c9496ef6e22f5af9 (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
49
50
51
52
53
54
55
#!/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 ministore-*.tar.gz
rm -f ministore-*.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 ministore-${VERSION}.tar.gz | awk '{print $1}')
echo SHA256=$SHA256

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

echo == Updating PKGBUILD and install.sh...
tar xvf ministore-${VERSION}.tar.gz
mv ministore/arch/install.sh .

#rm -rf ministore-${VERSION}      # GitHub adds version to tar's internal folder
rm -rf ministore                  # Codeberg doesn't

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