Refactor
This commit is contained in:
parent
6ede3f09c3
commit
dd6037f6f5
28
pkgbuild.sh
28
pkgbuild.sh
|
@ -1,5 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
getInputs() {
|
||||
gpgPrivateKey="$INPUT_GPGPRIVATEKEY"
|
||||
gpgPublicKey="$INPUT_GPGPUBLICKEY"
|
||||
gpgPassphrase="$INPUT_GPGPASSPHRASE"
|
||||
pkgDir="$INPUT_PKGDIR"
|
||||
}
|
||||
|
||||
addUser() {
|
||||
useradd calbuilder -m
|
||||
echo "calbuilder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
|
@ -70,6 +77,13 @@ namcapAnalysis() {
|
|||
fi
|
||||
}
|
||||
|
||||
exportFile() {
|
||||
echo "::set-output name=$1::$2"
|
||||
if [ "$inBaseDir" = false ]; then
|
||||
mv "$pkgFile" /github/workspace
|
||||
fi
|
||||
}
|
||||
|
||||
exportPackageFiles() {
|
||||
sudo -u calbuilder makepkg --printsrcinfo > .SRCINFO
|
||||
exportFile "srcInfo" ".SRCINFO"
|
||||
|
@ -84,20 +98,6 @@ exportPackageFiles() {
|
|||
fi
|
||||
}
|
||||
|
||||
exportFile() {
|
||||
echo "::set-output name=$1::$2"
|
||||
if [ "$inBaseDir" = false ]; then
|
||||
mv "$pkgFile" /github/workspace
|
||||
fi
|
||||
}
|
||||
|
||||
getInputs() {
|
||||
gpgPrivateKey="$INPUT_GPGPRIVATEKEY"
|
||||
gpgPublicKey="$INPUT_GPGPUBLICKEY"
|
||||
gpgPassphrase="$INPUT_GPGPASSPHRASE"
|
||||
pkgDir="$INPUT_PKGDIR"
|
||||
}
|
||||
|
||||
runScript() {
|
||||
set -euo pipefail
|
||||
|
||||
|
|
Loading…
Reference in New Issue