Skip to content

Commit 01f7ce7

Browse files
committed
📦 Add automated AUR package publishing to CI/CD pipeline
Extend release workflow with update-aur job that: - Generates PKGBUILD with dynamically calculated SHA256 checksums for both x86_64 and aarch64 Linux binaries - Uses KSXGitHub/github-actions-deploy-aur action to push updates - Runs automatically on version tags after release creation This enables Arch Linux users to install via yay or paru from AUR without manual PKGBUILD maintenance.
1 parent b2fd202 commit 01f7ce7

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/cicd.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,3 +549,53 @@ jobs:
549549
git add Formula/git-iris.rb
550550
git commit -m "git-iris ${{ steps.sha.outputs.version }}"
551551
git push
552+
553+
# Update AUR package with new release
554+
update-aur:
555+
name: 📦 Update AUR Package
556+
if: startsWith(github.ref, 'refs/tags/v')
557+
needs: create-release
558+
runs-on: ubuntu-latest
559+
steps:
560+
- name: 📥 Checkout
561+
uses: actions/checkout@v4
562+
563+
- name: 📝 Generate PKGBUILD
564+
run: |
565+
VERSION="${GITHUB_REF_NAME#v}"
566+
SHA_X86_64=$(curl -fsSL "https://github.com/hyperb1iss/git-iris/releases/download/${GITHUB_REF_NAME}/git-iris-linux-amd64" | sha256sum | cut -d' ' -f1)
567+
SHA_AARCH64=$(curl -fsSL "https://github.com/hyperb1iss/git-iris/releases/download/${GITHUB_REF_NAME}/git-iris-linux-arm64" | sha256sum | cut -d' ' -f1)
568+
569+
cat > PKGBUILD << EOF
570+
# Maintainer: Stefanie Jane <[email protected]>
571+
pkgname=git-iris-bin
572+
pkgver=${VERSION}
573+
pkgrel=1
574+
pkgdesc="An intelligent agent that understands your code and crafts perfect Git artifacts"
575+
arch=('x86_64' 'aarch64')
576+
url="https://github.com/hyperb1iss/git-iris"
577+
license=('Apache-2.0')
578+
provides=('git-iris')
579+
conflicts=('git-iris')
580+
depends=('gcc-libs' 'openssl')
581+
582+
source_x86_64=("\${pkgname}-\${pkgver}-x86_64::https://github.com/hyperb1iss/git-iris/releases/download/v\${pkgver}/git-iris-linux-amd64")
583+
source_aarch64=("\${pkgname}-\${pkgver}-aarch64::https://github.com/hyperb1iss/git-iris/releases/download/v\${pkgver}/git-iris-linux-arm64")
584+
585+
sha256sums_x86_64=('${SHA_X86_64}')
586+
sha256sums_aarch64=('${SHA_AARCH64}')
587+
588+
package() {
589+
install -Dm755 "\${srcdir}/\${pkgname}-\${pkgver}-\${CARCH}" "\${pkgdir}/usr/bin/git-iris"
590+
}
591+
EOF
592+
593+
- name: 🚀 Publish to AUR
594+
uses: KSXGitHub/[email protected]
595+
with:
596+
pkgname: git-iris-bin
597+
pkgbuild: ./PKGBUILD
598+
commit_username: Stefanie Jane
599+
commit_email: [email protected]
600+
ssh_private_key: ${{ secrets.AUR_SSH_KEY }}
601+
commit_message: "Update to ${GITHUB_REF_NAME#v}"

0 commit comments

Comments
 (0)