Paru has not been updated in months and is incompatible with the current
version of pacman / libalpm, which is v16.0.0. See upstream issue [1].
Replace paru with yay so the action works again.
Also updated CI test with latest Spotify as the old version is gone now.
[1] https://github.com/Morganamilo/paru/issues/1454
Without this, the only way to build PKGBUILDs with signatures is to pass
--skippgpcheck to makepkg.
Also switched to a package with PGP keys to verify.
[](https://github.com/datakrama/archlinux-package-action/actions) [](https://github.com/datakrama/archlinux-package-action/releases) [](./LICENSE)
[](https://github.com/heyhusen/archlinux-package-action/actions) [](https://github.com/heyhusen/archlinux-package-action/releases) [](./LICENSE)
This action allows running tools needed for creating Arch Linux (and AUR) package.
This action allows running tools needed for creating Arch Linux (and AUR) package.
Here's what this action can do:
Here's what this action can do:
- Update checksums on PKGBUILD file
- Update `pkgver`, `pkgrel`, or checksums on PKGBUILD file
- Generate [.SRCINFO](https://wiki.archlinux.org/title/.SRCINFO) based on your PKGBUILD
- Validate PKGBUILD with [namcap](https://wiki.archlinux.org/title/namcap)
- Validate PKGBUILD with [namcap](https://wiki.archlinux.org/title/namcap)
- Generate [.SRCINFO](https://wiki.archlinux.org/title/.SRCINFO) based on your PKGBUILD
- Run [makepkg](https://wiki.archlinux.org/title/Makepkg) with custom flags (rather than default)
- Run [makepkg](https://wiki.archlinux.org/title/Makepkg) with custom flags (rather than default)
## Usage
## Usage
### Requirement
### Requirement
- [PKGBUILD](https://wiki.archlinux.org/title/PKGBUILD) file inside your repository.
- [PKGBUILD](https://wiki.archlinux.org/title/PKGBUILD) file inside your repository.
- Use [actions/checkout](https://github.com/actions/checkout) in previous step. This is important, unless you want your [$GITHUB_WORKSPACE](https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables) folder to be empty.
### Customizing
### Customizing
Following inputs can be used as `step.with` keys
Following inputs can be used as `step.with` keys
| Name | Type | Default | Required | Description |
| Name | Type | Default | Required | Description |
# If there is a custom path, we need to copy the whole repository
sudo chown -R builder $WORKPATH
# because we run "git diff" at several stages and without the entire
cd$WORKPATH
# tree the output will be incorrect.
if[[ -n $INPUT_PATH]];then
cp -rTfv "$GITHUB_WORKSPACE"/ ./
cd$INPUT_PATH
else
# Without a custom path though, we can just grab the .git directory and the PKGBUILD.
cp -rfv "$GITHUB_WORKSPACE"/.git ./
cp -fv "$GITHUB_WORKSPACE"/PKGBUILD ./
fi
echo"::endgroup::"
# Update archlinux-keyring
if[[$INPUT_ARCHLINUX_KEYRING==true]];then
echo"::group::Updating archlinux-keyring"
sudo pacman -Syu --noconfirm archlinux-keyring
echo"::endgroup::"
fi
# Update pkgver
if[[ -n $INPUT_PKGVER]];then
echo"::group::Updating pkgver on PKGBUILD"
sed -i "s:^pkgver=.*$:pkgver=$INPUT_PKGVER:g" PKGBUILD
git --no-pager diff PKGBUILD
echo"::endgroup::"
fi
# Update pkgrel
if[[ -n $INPUT_PKGREL]];then
echo"::group::Updating pkgrel on PKGBUILD"
sed -i "s:^pkgrel=.*$:pkgrel=$INPUT_PKGREL:g" PKGBUILD
git --no-pager diff PKGBUILD
echo"::endgroup::"
fi
# Update checksums
# Update checksums
if[[$INPUT_UPDPKGSUMS==true]];then
if[[$INPUT_UPDPKGSUMS==true]];then
echo"Update checksums on PKGBUILD"
echo"::group::Updating checksums on PKGBUILD"
sudo -u builder updpkgsums
updpkgsums
git diff PKGBUILD
git --no-pager diff PKGBUILD
echo"::endgroup::"
fi
fi
# Generate .SRCINFO
# Generate .SRCINFO
if[[$INPUT_SRCINFO==true]];then
if[[$INPUT_SRCINFO==true]];then
echo"Generate new .SRCINFO based on PKGBUILD"
echo"::group::Generating new .SRCINFO based on PKGBUILD"
sudo -u builder makepkg --printsrcinfo >.SRCINFO
makepkg --printsrcinfo >.SRCINFO
git diff .SRCINFO
git --no-pager diff .SRCINFO
fi
echo"::endgroup::"
# Run makepkg
if[[ -n "$INPUT_FLAGS"]];then
echo"Run makepkg with flags"
sudo -u builder makepkg $INPUT_FLAGS
fi
fi
# Validate with namcap
# Validate with namcap
if[[$INPUT_NAMCAP==true]];then
if[[$INPUT_NAMCAP==true]];then
echo"Validate PKGBUILD with namcap"
echo"::group::Validating PKGBUILD with namcap"
namcap -i PKGBUILD
namcap -i PKGBUILD
echo"::endgroup::"
fi
fi
# Install depends using yay from aur
if[[$INPUT_AUR==true]];then
echo"::group::Installing depends using yay"
source PKGBUILD
yay -Syu --removemake --needed --noconfirm "${depends[@]}""${makedepends[@]}"
echo"::endgroup::"
fi
# Run makepkg
if[[ -n $INPUT_FLAGS]];then
echo"::group::Running makepkg with flags"
makepkg $INPUT_FLAGS
echo"::endgroup::"
fi
WORKPATH=$GITHUB_WORKSPACE/$INPUT_PATH
WORKPATH=${WORKPATH%/}# Remove trailing slash if $INPUT_PATH is empty
echo"::group::Copying files from $HOME/gh-action to $WORKPATH"
sudo cp -fv PKGBUILD "$WORKPATH"/PKGBUILD
if[[ -e .SRCINFO ]];then
sudo cp -fv .SRCINFO "$WORKPATH"/.SRCINFO
fi
echo"::endgroup::"
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.