diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b09b58..2670c9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Test build on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] workflow_dispatch: jobs: @@ -12,17 +12,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@master - - name: Build Package - uses: ./ - with: - package_name: ciallo - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: Build Package + uses: ./ + with: + package_name: ciallo + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} + pkgs_directory: test - - name: Upload Package - uses: actions/upload-artifact@main - with: - name: ciallo-package - path: test/ciallo/*.pkg.tar.zst* + - name: Upload Package + uses: actions/upload-artifact@main + with: + name: ciallo-package + path: test/ciallo/*.pkg.tar.zst* diff --git a/Dockerfile b/Dockerfile index 75c4d0a..39d24ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ FROM archlinux:base-devel RUN pacman -Syu --noconfirm -RUN pacman -S git gnupg --noconfirm +RUN pacman -S git gnupg tree --noconfirm + COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml index 4b02fcb..2bcc150 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,10 @@ inputs: gpg_passphrase: description: "GPG passphrase for building" required: true + pkgs_directory: + description: "Directory of package subdirectories" + required: false + default: "." runs: using: "docker" image: "Dockerfile" @@ -16,3 +20,4 @@ runs: - ${{ inputs.package_name }} - ${{ inputs.gpg_private_key }} - ${{ inputs.gpg_passphrase }} + - ${{ inputs.pkgs_directory }} diff --git a/entrypoint.sh b/entrypoint.sh index 3d83349..37d87fa 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,13 +5,15 @@ set -e pkgname=$1 gpg_private_key=$2 gpg_passphrase=$3 +pkgdir=$4 # Create builder user useradd builder -m echo "builder ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers # Find the PKGBUILD directory -pkgbuild_dir=$(readlink -f "$pkgname") +pkgbuild_dir=$(readlink -f "$pkgdir/$pkgname") +tree if [[ ! -d $pkgbuild_dir ]]; then echo "$pkgbuild_dir should be a directory."