From 3673b22009cef0ecfe94993e94630eab9c1f1500 Mon Sep 17 00:00:00 2001 From: nevaforget Date: Wed, 1 Apr 2026 14:59:33 +0200 Subject: [PATCH] Add CI workflow to auto-update pkgver in moonarch-pkgbuilds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same pattern as moongreet/moonlock/moonset — pushes to main trigger a pkgver bump so paru detects updates. --- .gitea/workflows/update-pkgver.yaml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflows/update-pkgver.yaml diff --git a/.gitea/workflows/update-pkgver.yaml b/.gitea/workflows/update-pkgver.yaml new file mode 100644 index 0000000..a9afbc8 --- /dev/null +++ b/.gitea/workflows/update-pkgver.yaml @@ -0,0 +1,42 @@ +# ABOUTME: Updates pkgver in moonarch-pkgbuilds after a push to main. +# ABOUTME: Ensures paru detects new versions of this package. + +name: Update PKGBUILD version + +on: + push: + branches: + - main + +jobs: + update-pkgver: + runs-on: moonarch + steps: + - name: Checkout source repo + run: | + git clone --bare http://gitea:3000/nevaforget/moonarch.git source.git + cd source.git + PKGVER=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)") + echo "New pkgver: $PKGVER" + echo "$PKGVER" > /tmp/pkgver + + - name: Update PKGBUILD + run: | + PKGVER=$(cat /tmp/pkgver) + git clone http://gitea:3000/nevaforget/moonarch-pkgbuilds.git pkgbuilds + cd pkgbuilds + + OLD_VER=$(grep '^pkgver=' moonarch-git/PKGBUILD | cut -d= -f2) + if [ "$OLD_VER" = "$PKGVER" ]; then + echo "pkgver already up to date ($PKGVER)" + exit 0 + fi + + sed -i "s/^pkgver=.*/pkgver=$PKGVER/" moonarch-git/PKGBUILD + echo "Updated pkgver: $OLD_VER → $PKGVER" + + git config user.name "pkgver-bot" + git config user.email "gitea@moonarch.de" + git add moonarch-git/PKGBUILD + git commit -m "chore(moonarch-git): bump pkgver to $PKGVER" + git -c http.extraHeader="Authorization: token ${{ secrets.PKGBUILD_TOKEN }}" push