Skip to content

Commit 885f09e

Browse files
committed
ci(aur): add GitHub actions workflow for AUR publishing
1 parent 837c304 commit 885f09e

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/aur-publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish to AUR
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
aur:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up SSH key for AUR
17+
uses: webfactory/[email protected]
18+
with:
19+
ssh-private-key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
20+
21+
- name: Set up Git config
22+
run: |
23+
git config --global user.name "github-actions[bot]"
24+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
25+
26+
- name: Get tag version
27+
id: get_version
28+
run: |
29+
echo "TAG=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
30+
31+
- name: Update PKGBUILD version
32+
run: |
33+
sed -i "s/^pkgver=.*/pkgver=${{ steps.get_version.outputs.TAG }}/" PKGBUILD
34+
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
35+
36+
- name: Clone AUR repo
37+
run: |
38+
git clone ssh://[email protected]/tabby-cli.git aur-repo
39+
40+
- name: Copy PKGBUILD
41+
run: |
42+
cp PKGBUILD aur-repo/
43+
44+
- name: Commit and push to AUR
45+
run: |
46+
cd aur-repo
47+
makepkg --printsrcinfo > .SRCINFO
48+
git add PKGBUILD .SRCINFO
49+
git commit -m "Update to version ${{ steps.get_version.outputs.TAG }}" || echo "No changes to commit"
50+
git branch -M master
51+
git push

0 commit comments

Comments
 (0)