cli/pack.sh

43 lines
727 B
Bash
Raw Normal View History

2023-10-23 18:54:44 +05:30
#!/bin/bash
2023-10-23 19:10:58 +05:30
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# SPDX-License-Identifier: MIT
2023-10-23 18:54:44 +05:30
set -xEeuo pipefail
GPG_TTY=$(tty)
DIST_DIR=dist
pack() {
SRC=build/$1/
TARBALL=$DIST_DIR/$1.tar.gz
cp README.md $SRC
2023-10-23 19:10:58 +05:30
cp -r ./LICENSES/ $SRC
2023-10-23 18:54:44 +05:30
tar -cvzf $TARBALL $SRC
gpg --verbose \
--pinentry-mode loopback \
--batch --yes \
--passphrase $GPG_PASSWORD \
--local-user $KEY \
--output $TARBALL.asc \
--sign --detach \
--armor $TARBALL
pushd $DIST_DIR
local_tar=$1.tar.gz
sha256sum $local_tar > $local_tar.sha256
sha256sum $local_tar.asc >> $local_tar.sha256
popd
}
rm -rf $DIST_DIR
mkdir $DIST_DIR
for i in build/*
do
arch=$(echo $i | cut -d '/' -f 2)
pack $arch
done