Skip to content

Commit d264704

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

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ commit_message=$INPUT_COMMIT_MESSAGE
1313
allow_empty_commits=$INPUT_ALLOW_EMPTY_COMMITS
1414
force_push=$INPUT_FORCE_PUSH
1515
ssh_keyscan_types=$INPUT_SSH_KEYSCAN_TYPES
16+
update_pkgver=$UPDATE_PKGVER
1617

1718
assert_non_empty() {
1819
name=$1
@@ -53,6 +54,21 @@ git config --global user.name "$commit_username"
5354
git config --global user.email "$commit_email"
5455
echo '::endgroup::'
5556

57+
echo '::group::Updating pkgver'
58+
if [ "$update_pkgver" = "true" ]; then
59+
echo 'Running `makepkg -od` to update pkgver'
60+
mkdir -p /tmp/makepkg
61+
cp "$pkgbuild" /tmp/makepkg/PKGBUILD
62+
(
63+
cd /tmp/makepkg;
64+
makepkg -od;
65+
)
66+
pkgbuild=/tmp/makepkg/PKGBUILD
67+
else
68+
echo 'Not updating pkgver'
69+
fi
70+
echo '::endgroup::'
71+
5672
echo '::group::Cloning AUR package into /tmp/local-repo'
5773
git clone -v "https://aur.archlinux.org/${pkgname}.git" /tmp/local-repo
5874
echo '::endgroup::'
@@ -75,6 +91,7 @@ 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)