Skip to content

Commit

Permalink
rename run_command to post_process following the suggestions #33 (com…
Browse files Browse the repository at this point in the history
…ment)

- no extra package is installed
  • Loading branch information
susurri committed Mar 17, 2023
1 parent 1433afb commit ab00d5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 base-devel
pacman-contrib

COPY entrypoint.sh /entrypoint.sh
COPY build.sh /build.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Glob patterns will be expanded by bash when copying the files to the repository.

**Optional** Command line flags for makepkg to build the package (if `test` is enabled). The default flags are `--clean --cleanbuild --nodeps`.

### `run_command`
### `post_process`

**Optional** Install the package and run the specified command to make sure the installed package works.
**Optional** A line of commands to execute after processing the package.

### `commit_username`

Expand Down
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ 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'
post_process:
description: 'A line of commands to execute after processing the package'
required: false
default: ''
commit_username:
description: 'The username to use when creating the new commit'
required: true
Expand Down
11 changes: 4 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assets=$INPUT_ASSETS
updpkgsums=$INPUT_UPDPKGSUMS
test=$INPUT_TEST
read -r -a test_flags <<< "$INPUT_TEST_FLAGS"
run_command=$INPUT_RUN_COMMAND
post_process=$INPUT_POST_PROCESS
commit_username=$INPUT_COMMIT_USERNAME
commit_email=$INPUT_COMMIT_EMAIL
ssh_private_key=$INPUT_SSH_PRIVATE_KEY
Expand Down Expand Up @@ -93,13 +93,10 @@ 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
if [ -n "$post_process" ]; then
echo '::group::Executing post process commands'
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"
eval "$post_process"
echo '::endgroup::'
fi

Expand Down

0 comments on commit ab00d5a

Please sign in to comment.