Skip to content

Commit ab59c61

Browse files
committed
Automatically update pkgver using makepkg
1 parent 50ce1d5 commit ab59c61

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

build.sh

+17
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ git config --global user.name "$commit_username"
5353
git config --global user.email "$commit_email"
5454
echo '::endgroup::'
5555

56+
echo '::group::Updating pkgver'
57+
if grep -q 'pkgver()' $pkgbuild; then
58+
echo 'Running `makepkg -od` to update pkgver'
59+
mkdir -p /tmp/makepkg
60+
cp "$pkgbuild" /tmp/makepkg/PKGBUILD
61+
(
62+
cd /tmp/makepkg;
63+
makepkg -od;
64+
)
65+
pkgbuild=/tmp/makepkg/PKGBUILD
66+
else
67+
echo 'No pkgver() found in PKGBUILD'
68+
fi
69+
echo '::endgroup::'
70+
5671
echo '::group::Cloning AUR package into /tmp/local-repo'
5772
git clone -v "https://aur.archlinux.org/${pkgname}.git" /tmp/local-repo
5873
echo '::endgroup::'
@@ -70,11 +85,13 @@ if [[ -n "$assets" ]]; then
7085
fi
7186
echo '::endgroup::'
7287

88+
7389
echo '::group::Generating .SRCINFO'
7490
cd /tmp/local-repo
7591
makepkg --printsrcinfo >.SRCINFO
7692
echo '::endgroup::'
7793

94+
7895
echo '::group::Committing files to the repository'
7996
if [[ -z "$assets" ]]; then
8097
# When $assets are not set, we can add just PKGBUILD and .SRCINFO

0 commit comments

Comments
 (0)