diff --git a/pkgbuild.sh b/pkgbuild.sh index 25406d8..b25ea84 100755 --- a/pkgbuild.sh +++ b/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