Skip to content

Commit 037af8b

Browse files
committed
AUR support
1 parent 10867cf commit 037af8b

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.github/workflows/update-aur.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Update AUR Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update-aur:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout main repo
13+
uses: actions/checkout@v4
14+
with:
15+
repository: Matars/gitfetch
16+
path: gitfetch
17+
18+
- name: Get version from pyproject.toml
19+
id: get_version
20+
run: |
21+
VERSION=$(grep '^version =' gitfetch/pyproject.toml | sed 's/version = "\(.*\)"/\1/')
22+
echo "version=$VERSION" >> $GITHUB_OUTPUT
23+
24+
- name: Download release tarball
25+
run: |
26+
curl -L -o release.tar.gz https://github.com/Matars/gitfetch/archive/refs/tags/v${{ steps.get_version.outputs.version }}.tar.gz
27+
28+
- name: Calculate SHA256
29+
id: sha256
30+
run: |
31+
SHA256=$(shasum -a 256 release.tar.gz | cut -d' ' -f1)
32+
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
33+
34+
- name: Setup SSH
35+
run: |
36+
mkdir -p ~/.ssh
37+
echo "${{ secrets.AUR_TOKEN }}" > ~/.ssh/aur_key
38+
chmod 600 ~/.ssh/aur_key
39+
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts
40+
41+
- name: Clone AUR repo
42+
run: |
43+
git clone ssh://aur@aur.archlinux.org/gitfetch-python.git aur-repo
44+
cd aur-repo
45+
git config user.name "GitHub Actions"
46+
git config user.email "actions@github.com"
47+
48+
- name: Update PKGBUILD
49+
run: |
50+
cd aur-repo
51+
sed -i 's/pkgver=.*/pkgver=${{ steps.get_version.outputs.version }}/' PKGBUILD
52+
sed -i 's|source=.*|source=("$pkgname-$pkgver.tar.gz::https://github.com/Matars/gitfetch/archive/refs/tags/v$pkgver.tar.gz")|' PKGBUILD
53+
sed -i "s/sha256sums=.*/sha256sums=('${{ steps.sha256.outputs.sha256 }}')/" PKGBUILD
54+
55+
- name: Update .SRCINFO
56+
run: |
57+
cd aur-repo
58+
sed -i 's/pkgver = .*/pkgver = ${{ steps.get_version.outputs.version }}/' .SRCINFO
59+
sed -i 's|source = .*|source = gitfetch-python-${{ steps.get_version.outputs.version }}.tar.gz::https://github.com/Matars/gitfetch/archive/refs/tags/v${{ steps.get_version.outputs.version }}.tar.gz|' .SRCINFO
60+
sed -i "s/sha256sums = .*/sha256sums = ${{ steps.sha256.outputs.sha256 }}/" .SRCINFO
61+
62+
- name: Commit and push
63+
run: |
64+
cd aur-repo
65+
git add PKGBUILD .SRCINFO
66+
git commit -m "Update gitfetch-python to v${{ steps.get_version.outputs.version }}"
67+
GIT_SSH_COMMAND="ssh -i ~/.ssh/aur_key -o UserKnownHostsFile=~/.ssh/known_hosts" git push

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,27 @@ Or install directly without tapping:
6060
brew install matars/homebrew-gitfetch/gitfetch
6161
```
6262

63+
### Arch Linux (AUR)
64+
65+
```bash
66+
yay -S gitfetch
67+
```
68+
69+
Or with other AUR helpers:
70+
71+
```bash
72+
paru -S gitfetch
73+
trizen -S gitfetch
74+
```
75+
76+
Or manual build:
77+
78+
```bash
79+
git clone https://aur.archlinux.org/gitfetch.git
80+
cd gitfetch
81+
makepkg -si
82+
```
83+
6384
### From the sources
6485

6586
1. Clone this repo

0 commit comments

Comments
 (0)