NaviThingy-aur/.forgejo/workflows/update-aur.yml
creations 7304e637dd
Some checks failed
Auto-update AUR / update-aur (push) Failing after 30s
easdasd
2025-05-13 18:49:37 -04:00

85 lines
2.5 KiB
YAML

name: Auto-update AUR
on:
push:
branches: [ main ]
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 nodejs npm openssh
- 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: Configure AUR remote and sync
run: |
if ! git remote | grep -q "^aur$"; then
git remote add aur ssh://aur@aur.archlinux.org/navithingy-git.git
else
git remote set-url aur ssh://aur@aur.archlinux.org/navithingy-git.git
fi
git fetch aur master
git rebase aur/master
- 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
useradd -m builduser
chown -R builduser .
git config --global --add safe.directory "$PWD"
su builduser -c "makepkg --printsrcinfo > .SRCINFO"
- name: Clean and stage AUR files
run: |
find . -mindepth 1 -maxdepth 1 ! -name 'PKGBUILD' ! -name '.SRCINFO' ! -name 'navithingy-git.install' ! -name '.git' -exec rm -rf {} +
git reset
git add PKGBUILD .SRCINFO navithingy-git.install
if git diff --cached --quiet; then
echo "No changes to commit."
exit 0
fi
git commit -m "Update to ${{ env.pkgver }}"
git push aur HEAD:master