63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
name: AUR Sync
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
aur-sync:
|
|
runs-on: docker
|
|
container:
|
|
image: archlinux:latest
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
pacman -Syu --noconfirm nodejs git binutils openssh sudo
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup SSH
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
|
|
cat >> ~/.ssh/config <<EOF
|
|
Host aur.archlinux.org
|
|
IdentityFile ~/.ssh/id_ed25519
|
|
User aur
|
|
StrictHostKeyChecking no
|
|
EOF
|
|
|
|
ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.name "nekohepott"
|
|
git config --global user.email "nekohepott@larpdhq.org"
|
|
|
|
- name: Sync to AUR
|
|
run: |
|
|
chown -R nobody:nobody .
|
|
chmod -R 777 .
|
|
|
|
git clone ssh://aur@aur.archlinux.org/gogofetch-git.git /tmp/aur
|
|
|
|
sudo -u nobody makepkg --nodeps --nobuild --force
|
|
sudo -u nobody makepkg --printsrcinfo > .SRCINFO
|
|
|
|
|
|
cp PKGBUILD .SRCINFO /tmp/aur/
|
|
|
|
cd /tmp/aur
|
|
git config user.name "nekohepott"
|
|
git config user.email "nekohepott@larpdhq.org"
|
|
|
|
if [[ -n $(git status -s) ]]; then
|
|
git add PKGBUILD .SRCINFO
|
|
git commit -m "Update from Codeberg CI: ${GITHUB_SHA::7}"
|
|
git push
|
|
else
|
|
echo "No changes to commit"
|
|
fi |