@@ -21,25 +21,53 @@ jobs:
2121 VERSION=$(grep '^version =' gitfetch/pyproject.toml | sed 's/version = "\(.*\)"/\1/')
2222 echo "version=$VERSION" >> $GITHUB_OUTPUT
2323
24- - name : Checkout AUR repo
25- uses : actions/checkout@v4
26- with :
27- repository : Matars/aur-gitfetch
28- token : ${{ secrets.AUR_TAP_TOKEN }}
29- path : aur-repo
24+ - name : Install AUR tools
25+ run : |
26+ sudo apt-get update
27+ sudo apt-get install -y git
28+
29+ - name : Setup SSH for AUR
30+ run : |
31+ mkdir -p ~/.ssh
32+ echo "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/aur_key
33+ chmod 600 ~/.ssh/aur_key
34+ echo "Host aur.archlinux.org" >> ~/.ssh/config
35+ echo " IdentityFile ~/.ssh/aur_key" >> ~/.ssh/config
36+ echo " User aur" >> ~/.ssh/config
37+ ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
38+
39+ - name : Clone AUR package
40+ run : |
41+ git clone ssh://aur@aur.archlinux.org/gitfetch-python.git aur-repo
3042
3143 - name : Update PKGBUILD
3244 run : |
3345 cd aur-repo
3446 VERSION=${{ steps.get_version.outputs.version }}
47+
48+ SOURCE_URL="https://github.com/Matars/gitfetch/archive/refs/tags/v${VERSION}.tar.gz"
49+ SHA256=$(curl -sL "$SOURCE_URL" | sha256sum | awk '{print $1}')
50+
3551 sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD
3652 sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
53+ sed -i "s|^source=.*|source=(\"$SOURCE_URL\")|" PKGBUILD
54+ sed -i "s/^sha256sums=.*/sha256sums=('$SHA256')/" PKGBUILD
55+
56+ - name : Generate .SRCINFO
57+ run : |
58+ cd aur-repo
59+ docker run --rm -v $(pwd):/pkg archlinux:latest /bin/bash -c "
60+ pacman -Syu --noconfirm
61+ pacman -S --noconfirm namcap
62+ cd /pkg
63+ makepkg --printsrcinfo > .SRCINFO
64+ "
3765
38- - name : Commit and push
66+ - name : Commit and push to AUR
3967 run : |
4068 cd aur-repo
41- git config user.name "GitHub Actions "
42- git config user.email "actions@github .com"
43- git add PKGBUILD
44- git commit -m "Update gitfetch to v${{ steps.get_version.outputs.version }}"
69+ git config user.name "Matar "
70+ git config user.email "khaledmatar19733@gmail .com"
71+ git add PKGBUILD .SRCINFO
72+ git commit -m "Update gitfetch-python to v${{ steps.get_version.outputs.version }}"
4573 git push
0 commit comments