Add support for signing packages

This commit is contained in:
Santiago Lo Coco 2022-02-28 23:59:01 -03:00
parent 7019ab4922
commit 5a206374b0
1 changed files with 13 additions and 1 deletions

View File

@ -6,8 +6,20 @@ setPermissions() {
chmod -R a+rw .
}
importPrivateKey() {
echo "$INPUT_GPGPRIVATEKEY" > private.key
sudo -u nobody gpg --batch --pinentry-mode loopback --passphrase "$INPUT_GPGPASSPHRASE" --import private.key
rm private.key
sed -i -e "s/gpg/gpg --batch --pinentry-mode loopback --passphrase \"$INPUT_GPGPASSPHRASE\"/" /usr/share/makepkg/integrity/generate_signature.sh
}
buildPackage() {
sudo -u nobody makepkg -s --noconfirm
if [ -n "$INPUT_GPGPRIVATEKEY" ] && [ -n "$INPUT_GPGPUBLICKEY" ]; then
importPrivateKey
sudo -u nobody makepkg -s --sign --key "$INPUT_GPGPUBLICKEY" --noconfirm
else
sudo -u nobody makepkg -s --noconfirm
fi
}
exportPackageFiles() {