feat: add make_release helper script

This commit is contained in:
CJ van den Berg 2024-11-18 19:28:58 +01:00
parent 6d351080a8
commit 92b3b93a1c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 69 additions and 1 deletions

45
contrib/make_release Executable file
View file

@ -0,0 +1,45 @@
#!/bin/bash
set -e
BASEDIR="$(cd "$(dirname "$0")/.." && pwd)"
APPNAME="$(basename "$BASEDIR")"
cd "$BASEDIR"
if [ -e "release" ]; then
echo directory \"release\" already exists
exit 1
fi
echo building...
./zig build -Dpackage_release --prefix release/build
cd release/build
VERSION=$(/bin/cat version)
TARGETS=$(/bin/ls)
for target in $TARGETS; do
if [ -d "$target" ]; then
cd "$target"
echo packing "$target"...
tar -czf "../../${APPNAME}-${VERSION}-${target}.tar.gz" -- *
cd ..
fi
done
cd ..
rm -r build
TARFILES=$(/bin/ls)
for tarfile in $TARFILES; do
echo signing "$tarfile"...
gpg --local-user 4E6CF7234FFC4E14531074F98EB1E1BB660E3FB9 --detach-sig "$tarfile"
done
echo "done making release $VERSION"
echo
/bin/ls -lah