diff --git a/README.md b/README.md index 2f2f583..473aa22 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ Glob patterns will be expanded by bash when copying the files to the repository. **Optional** Update checksums using `updpkgsums`. +### `test` + +**Optional** Check that PKGBUILD could be built. + ### `commit_username` **Required** The username to use when creating the new commit. diff --git a/action.yml b/action.yml index ed83c27..91d0f57 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,10 @@ inputs: description: 'Update checksums using `updpkgsums`' required: false default: 'false' + test: + description: 'Check that PKGBUILD could be built' + required: false + default: 'false' commit_username: description: 'The username to use when creating the new commit' required: true diff --git a/build.sh b/build.sh index c509bf3..988b53e 100755 --- a/build.sh +++ b/build.sh @@ -7,6 +7,7 @@ pkgname=$INPUT_PKGNAME pkgbuild=$INPUT_PKGBUILD assets=$INPUT_ASSETS updpkgsums=$INPUT_UPDPKGSUMS +test=$INPUT_TEST commit_username=$INPUT_COMMIT_USERNAME commit_email=$INPUT_COMMIT_EMAIL ssh_private_key=$INPUT_SSH_PRIVATE_KEY @@ -78,6 +79,13 @@ if [ "$updpkgsums" == "true" ]; then echo '::endgroup::' fi +if [ "$test" == "true" ]; then + echo '::group::Building package with makepkg' + cd /tmp/local-repo/ + makepkg --clean --cleanbuild --nodeps + echo '::endgroup::' +fi + echo '::group::Generating .SRCINFO' cd /tmp/local-repo makepkg --printsrcinfo >.SRCINFO