NaviThingy-aur/.forgejo/workflows/update-aur.yml
creations 3ce74daadf
Some checks failed
Auto-update AUR / update-aur (push) Failing after 21s
erm
2025-05-13 18:25:39 -04:00

65 lines
1.9 KiB
YAML

name: Auto-update AUR
on:
push:
branches: [ dev ]
workflow_dispatch:
jobs:
update-aur:
runs-on: docker
container:
image: archlinux:latest
steps:
- name: Install Arch build tools
run: |
pacman -Sy --noconfirm git base-devel
- name: Checkout AUR repo
uses: actions/checkout@v4
- name: Set up Git identity
run: |
git config --global user.name "creations"
git config --global user.email "aur@creations.works"
- name: Set up SSH for AUR
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
cat >> ~/.ssh/config <<EOF
Host aur.archlinux.org
User aur
IdentityFile ~/.ssh/aur
IdentitiesOnly yes
StrictHostKeyChecking no
EOF
- name: Clone upstream NaviThingy and compute pkgver
run: |
git clone --depth=1 https://github.com/vMohammad24/NaviThingy.git NaviThingy
cd NaviThingy
tag=$(git describe --tags --abbrev=0 | sed 's/^NaviThingy//' | tr -d 'v')
rev=$(git rev-list --count HEAD)
commit=$(git rev-parse --short HEAD)
echo "pkgver=${tag}.r${rev}.${commit}" >> $GITHUB_ENV
- name: Patch PKGBUILD and regenerate .SRCINFO
run: |
echo "Using pkgver=${{ env.pkgver }}"
sed -i "s/^pkgver=.*/pkgver=${{ env.pkgver }}/" PKGBUILD
makepkg --printsrcinfo > .SRCINFO
- name: Push to AUR
run: |
git remote add aur ssh://aur@aur.archlinux.org/navithingy-git.git
git add PKGBUILD .SRCINFO
if git diff --cached --quiet; then
echo "No changes to commit."
exit 0
fi
git commit -m "Update to ${{ env.pkgver }}"
git push aur master