From b1fc840ce56c3cb0494f35557ef770a71b34616c Mon Sep 17 00:00:00 2001 From: Roman Geraskin Date: Mon, 8 Aug 2022 20:22:40 +0300 Subject: [PATCH 1/2] Add makepkg option Optional basic check that PKGBUILD could be built --- README.md | 4 ++++ action.yml | 4 ++++ build.sh | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 2f2f583..6a2c869 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`. +### `makepkg` + +**Optional** Build package using `makepkg` before deploy. + ### `commit_username` **Required** The username to use when creating the new commit. diff --git a/action.yml b/action.yml index ed83c27..9d4c77a 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,10 @@ inputs: description: 'Update checksums using `updpkgsums`' required: false default: 'false' + makepkg: + description: 'Build package using `makepkg` before deploy' + 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..3ecedb1 100755 --- a/build.sh +++ b/build.sh @@ -7,6 +7,7 @@ pkgname=$INPUT_PKGNAME pkgbuild=$INPUT_PKGBUILD assets=$INPUT_ASSETS updpkgsums=$INPUT_UPDPKGSUMS +makepkg=$INPUT_MAKEPKG 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 [ "$makepkg" == "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 From 89cbe4c6760a199744d0e3a15b296f8f53d5d278 Mon Sep 17 00:00:00 2001 From: Roman Geraskin Date: Tue, 9 Aug 2022 13:15:49 +0300 Subject: [PATCH 2/2] rename makepkg option to 'test' --- README.md | 4 ++-- action.yml | 4 ++-- build.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6a2c869..473aa22 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ Glob patterns will be expanded by bash when copying the files to the repository. **Optional** Update checksums using `updpkgsums`. -### `makepkg` +### `test` -**Optional** Build package using `makepkg` before deploy. +**Optional** Check that PKGBUILD could be built. ### `commit_username` diff --git a/action.yml b/action.yml index 9d4c77a..91d0f57 100644 --- a/action.yml +++ b/action.yml @@ -19,8 +19,8 @@ inputs: description: 'Update checksums using `updpkgsums`' required: false default: 'false' - makepkg: - description: 'Build package using `makepkg` before deploy' + test: + description: 'Check that PKGBUILD could be built' required: false default: 'false' commit_username: diff --git a/build.sh b/build.sh index 3ecedb1..988b53e 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ pkgname=$INPUT_PKGNAME pkgbuild=$INPUT_PKGBUILD assets=$INPUT_ASSETS updpkgsums=$INPUT_UPDPKGSUMS -makepkg=$INPUT_MAKEPKG +test=$INPUT_TEST commit_username=$INPUT_COMMIT_USERNAME commit_email=$INPUT_COMMIT_EMAIL ssh_private_key=$INPUT_SSH_PRIVATE_KEY @@ -79,7 +79,7 @@ if [ "$updpkgsums" == "true" ]; then echo '::endgroup::' fi -if [ "$makepkg" == "true" ]; then +if [ "$test" == "true" ]; then echo '::group::Building package with makepkg' cd /tmp/local-repo/ makepkg --clean --cleanbuild --nodeps