diff --git a/Dockerfile b/Dockerfile index baa1e14..3ec4bac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN pacman -S --noconfirm --needed --overwrite '*' \ git fakeroot binutils gcc awk binutils xz \ libarchive bzip2 coreutils file findutils \ gettext grep gzip sed ncurses util-linux \ - pacman-contrib + pacman-contrib base-devel COPY entrypoint.sh /entrypoint.sh COPY build.sh /build.sh diff --git a/action.yml b/action.yml index 6ce6b01..f7d8e0c 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,9 @@ inputs: description: 'Command line flags for makepkg to build the package (if `test` is enabled)' required: false default: '--clean --cleanbuild --nodeps' + run_command: + description: 'Command to run after installing the package' + required: false commit_username: description: 'The username to use when creating the new commit' required: true diff --git a/build.sh b/build.sh index dcd6db5..f8ab704 100755 --- a/build.sh +++ b/build.sh @@ -9,6 +9,7 @@ assets=$INPUT_ASSETS updpkgsums=$INPUT_UPDPKGSUMS test=$INPUT_TEST read -r -a test_flags <<< "$INPUT_TEST_FLAGS" +run_command=$INPUT_RUN_COMMAND commit_username=$INPUT_COMMIT_USERNAME commit_email=$INPUT_COMMIT_EMAIL ssh_private_key=$INPUT_SSH_PRIVATE_KEY @@ -92,6 +93,16 @@ cd /tmp/local-repo makepkg --printsrcinfo >.SRCINFO echo '::endgroup::' +if [ -n "$run_command" ]; then + echo '::group::Installing package with makepkg and run command' + git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -si --noconfirm + cd /tmp/local-repo/ + grep -E 'depends' .SRCINFO | cut -f 3 -d ' '| sed -e 's/://' | xargs yay -S --noconfirm + makepkg -si --noconfirm + eval "$run_command" + echo '::endgroup::' +fi + echo '::group::Committing files to the repository' if [[ -z "$assets" ]]; then # When $assets are not set, we can add just PKGBUILD and .SRCINFO