diff options
author | Tharre <tharre3@gmail.com> | 2021-12-07 07:44:12 +0100 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2023-04-25 10:28:44 +0200 |
commit | 528620be31f8b94afe84bae3c8b5226fba547445 (patch) | |
tree | 48bb37402c3447191cd2f2e3074969f56d302fe7 /.github/workflows/build.sh | |
parent | 3d68751bc2a7ce7078ccddd2c3faeb0d1225fd46 (diff) | |
download | pkgbuilds-528620be31f8b94afe84bae3c8b5226fba547445.tar.gz pkgbuilds-528620be31f8b94afe84bae3c8b5226fba547445.tar.xz pkgbuilds-528620be31f8b94afe84bae3c8b5226fba547445.zip |
Add github actions to automatically build packages
Diffstat (limited to '.github/workflows/build.sh')
-rwxr-xr-x | .github/workflows/build.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh new file mode 100755 index 0000000..1aebcb4 --- /dev/null +++ b/.github/workflows/build.sh @@ -0,0 +1,32 @@ +#!/bin/bash -e + +CHROOT=/buildchroot + +for dir in $(aur-graph */.SRCINFO | tsort | tac); do + pushd "$dir" > /dev/null + + # directory may also reference the pkgbase, in which case test if the + # first package in pkgname is up to date + remotever="$(expac -S1 "%v" "$REPO_NAME/$dir" \ + || expac -S1 "%v" "$REPO_NAME/$(source PKGBUILD; printf %s "$pkgname")" \ + || echo NONE)" + + if [ $(vercmp "$remotever" \ + $(source PKGBUILD; printf %s "${epoch:-0}:$pkgver-$pkgrel")) -lt 0 ]; then + if [ ! -d "$CHROOT" ]; then + echo "=== Creating build chroot ===" + mkdir "$CHROOT" + mkarchroot -C /etc/pacman.conf "$CHROOT/root" base-devel + fi + + echo "=== Building $dir ===" + makechrootpkg -c -u -U build -D /repository -r "$CHROOT" + + sudo -u build SRCDEST=/tmp makepkg --packagelist | while IFS="" read -r pkg + do + repo-add -s "/repository/$REPO_NAME.db.tar.gz" "$pkg" + gpg --detach-sign "$pkg" + done + fi + popd > /dev/null +done |