Skip to content

Commit

Permalink
Merge pull request #33 from susurri/run_command
Browse files Browse the repository at this point in the history
feat: install the package with makepkg and run a command
  • Loading branch information
KSXGitHub authored Mar 18, 2023
2 parents 065b605 + ab00d5a commit 063daf7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ 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`.

### `post_process`

**Optional** A line of commands to execute after processing the package.

### `commit_username`

**Required** The username to use when creating the new commit.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ inputs:
description: 'Command line flags for makepkg to build the package (if `test` is enabled)'
required: false
default: '--clean --cleanbuild --nodeps'
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
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ assets=$INPUT_ASSETS
updpkgsums=$INPUT_UPDPKGSUMS
test=$INPUT_TEST
read -r -a test_flags <<< "$INPUT_TEST_FLAGS"
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 @@ -92,6 +93,13 @@ cd /tmp/local-repo
makepkg --printsrcinfo >.SRCINFO
echo '::endgroup::'

if [ -n "$post_process" ]; then
echo '::group::Executing post process commands'
cd /tmp/local-repo/
eval "$post_process"
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
Expand Down

0 comments on commit 063daf7

Please sign in to comment.