Skip to content

Commit 27e834a

Browse files
committed
Add AUR update workflow
1 parent 112a5e1 commit 27e834a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/update-aur.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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: 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
30+
31+
- name: Update PKGBUILD
32+
run: |
33+
cd aur-repo
34+
VERSION=${{ steps.get_version.outputs.version }}
35+
sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD
36+
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
37+
38+
- name: Commit and push
39+
run: |
40+
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 }}"
45+
git push

0 commit comments

Comments
 (0)