Skip to content

Commit 677a463

Browse files
Merge pull request #30 from CosmicPredator/feature/aur_publish
💚 Added AUR Publishing
2 parents f585d76 + e494e51 commit 677a463

File tree

5 files changed

+150
-3
lines changed

5 files changed

+150
-3
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,59 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v6
1414
with:
1515
fetch-depth: 0
1616

1717
- name: Run Make
18-
run: make BUILD_TYPE=DEBUG
18+
run: make BUILD_TYPE=RELEASE
1919

2020
- name: Upload Artifacts
2121
uses: actions/upload-artifact@v4
2222
with:
2323
name: build_artifacts
24-
path: build/*
24+
path: build/*
25+
26+
publish_to_aur:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout Source
31+
uses: actions/checkout@v6
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Install AUR tools
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y git openssh-client makepkg
39+
40+
- name: Setup SSH for AUR
41+
run: |
42+
mkdir -p ~/.ssh
43+
echo "${{ secrets.AUR_KEY }}" > ~/.ssh/rsa_aur
44+
chmod 600 ~/.ssh/rsa_aur
45+
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
46+
47+
- name: Extract version from tag
48+
id: version
49+
run: |
50+
VERSION=${GITHUB_REF#refs/tags/v}
51+
echo "version=$VERSION" >> $GITHUB_OUTPUT
52+
53+
- name: Update chibi-git AUR
54+
run: |
55+
git clone ssh://aur@aur.archlinux.org/chibi-cli-git.git
56+
cd chibi-git
57+
58+
# bump pkgrel to trigger rebuild
59+
current=$(grep '^pkgrel=' PKGBUILD | cut -d= -f2)
60+
next=$((current+1))
61+
sed -i "s/^pkgrel=.*/pkgrel=$next/" PKGBUILD
62+
63+
makepkg --printsrcinfo > .SRCINFO
64+
65+
git config user.name "github-actions"
66+
git config user.email "actions@github.com"
67+
git commit -am "update"
68+
git push
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/archlinuxpackages
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=archlinuxpackages
3+
4+
### ArchLinuxPackages ###
5+
*.tar
6+
*.tar.*
7+
*.jar
8+
*.exe
9+
*.msi
10+
*.zip
11+
*.tgz
12+
*.log
13+
*.log.*
14+
*.sig
15+
*.deb
16+
17+
pkg/
18+
src/
19+
20+
.SRCINFO
21+
22+
# End of https://www.toptal.com/developers/gitignore/api/archlinuxpackages
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Maintainer: CosmicPredator <cosmicpredator@proton.me>
2+
pkgname=chibi-cli-bin
3+
pkgver=1.2.0
4+
pkgrel=1
5+
pkgdesc="Chibi for AniList - A lightweight anime & manga tracker CLI app powered by AniList."
6+
arch=('x86_64')
7+
url="https://chibi-cli.pages.dev/"
8+
license=('GPL3')
9+
10+
source=(
11+
"https://github.com/CosmicPredator/chibi-cli/releases/download/${pkgver}/chibi_${pkgver}_amd64.deb"
12+
)
13+
sha256sums=(
14+
'5e7d7383774a0a8ab72b4d20ac522e4303c9a55f8aa3f97489f0a8f4fd55bfe3'
15+
)
16+
17+
options=('!debug')
18+
19+
package() {
20+
bsdtar -xf "$srcdir/chibi_${pkgver}_amd64.deb"
21+
bsdtar -xf data.tar.*
22+
23+
install -Dm755 usr/local/bin/chibi "$pkgdir/usr/bin/chibi"
24+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/archlinuxpackages
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=archlinuxpackages
3+
4+
### ArchLinuxPackages ###
5+
*.tar
6+
*.tar.*
7+
*.jar
8+
*.exe
9+
*.msi
10+
*.zip
11+
*.tgz
12+
*.log
13+
*.log.*
14+
*.sig
15+
*.deb
16+
17+
pkg/
18+
src/
19+
20+
.SRCINFO
21+
# End of https://www.toptal.com/developers/gitignore/api/archlinuxpackages
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
pkgname=chibi-cli-git
2+
_pkgname=chibi-cli
3+
pkgver=1.2.0.36.gf585d76
4+
pkgrel=1
5+
pkgdesc="Chibi for AniList - A lightweight anime & manga tracker CLI app powered by AniList."
6+
arch=('x86_64')
7+
url="https://chibi-cli.pages.dev/"
8+
git_url="https://github.com/CosmicPredator/chibi-cli"
9+
license=('GPL3')
10+
depends=('glibc')
11+
makedepends=('git' 'go>=1.25')
12+
provides=('chibi')
13+
conflicts=('chibi' 'chibi-cli-bin')
14+
options=('!debug')
15+
16+
source=("git+$git_url.git")
17+
sha256sums=('SKIP')
18+
19+
pkgver() {
20+
cd "$srcdir/$_pkgname"
21+
git describe --tags --long | sed 's/^v//;s/-/./g'
22+
}
23+
24+
build() {
25+
cd "$srcdir/$_pkgname"
26+
27+
LATEST_TAG=$(git describe --tags)
28+
LDFLAGS="-X main.VERSION=${LATEST_TAG}"
29+
30+
GOOS=linux GOARCH=amd64 \
31+
go build -ldflags="$LDFLAGS" -o chibi
32+
}
33+
34+
package() {
35+
install -Dm755 "$srcdir/$_pkgname/chibi" "$pkgdir/usr/bin/chibi"
36+
}

0 commit comments

Comments
 (0)