|
| 1 | +#!/bin/bash |
| 2 | +# Update AUR package for a new release |
| 3 | +# Usage: ./update-aur.sh v2.0.0 |
| 4 | + |
| 5 | +set -e |
| 6 | + |
| 7 | +VERSION="${1:-$(gh release view --repo hyperb1iss/git-iris --json tagName -q .tagName 2>/dev/null)}" |
| 8 | +if [ -z "$VERSION" ]; then |
| 9 | + echo "Usage: $0 <version>" |
| 10 | + echo "Example: $0 v2.0.0" |
| 11 | + exit 1 |
| 12 | +fi |
| 13 | + |
| 14 | +VERSION_NUM="${VERSION#v}" |
| 15 | +REPO="hyperb1iss/git-iris" |
| 16 | + |
| 17 | +echo "Updating AUR package to ${VERSION}..." |
| 18 | + |
| 19 | +# Calculate SHA256 checksums |
| 20 | +echo "Calculating checksums..." |
| 21 | +SHA_X86_64=$(curl -fsSL "https://github.com/${REPO}/releases/download/${VERSION}/git-iris-linux-amd64" | sha256sum | cut -d' ' -f1) |
| 22 | +SHA_AARCH64=$(curl -fsSL "https://github.com/${REPO}/releases/download/${VERSION}/git-iris-linux-arm64" | sha256sum | cut -d' ' -f1) |
| 23 | + |
| 24 | +echo " x86_64: ${SHA_X86_64}" |
| 25 | +echo " aarch64: ${SHA_AARCH64}" |
| 26 | + |
| 27 | +# Update PKGBUILD |
| 28 | +cat > PKGBUILD << EOF |
| 29 | +# Maintainer: Stefanie Jane <[email protected]> |
| 30 | +pkgname=git-iris-bin |
| 31 | +pkgver=${VERSION_NUM} |
| 32 | +pkgrel=1 |
| 33 | +pkgdesc="An intelligent agent that understands your code and crafts perfect Git artifacts" |
| 34 | +arch=('x86_64' 'aarch64') |
| 35 | +url="https://github.com/hyperb1iss/git-iris" |
| 36 | +license=('Apache-2.0') |
| 37 | +provides=('git-iris') |
| 38 | +conflicts=('git-iris') |
| 39 | +depends=('gcc-libs' 'openssl') |
| 40 | +
|
| 41 | +source_x86_64=("\${pkgname}-\${pkgver}-x86_64::https://github.com/hyperb1iss/git-iris/releases/download/v\${pkgver}/git-iris-linux-amd64") |
| 42 | +source_aarch64=("\${pkgname}-\${pkgver}-aarch64::https://github.com/hyperb1iss/git-iris/releases/download/v\${pkgver}/git-iris-linux-arm64") |
| 43 | +
|
| 44 | +sha256sums_x86_64=('${SHA_X86_64}') |
| 45 | +sha256sums_aarch64=('${SHA_AARCH64}') |
| 46 | +
|
| 47 | +package() { |
| 48 | + install -Dm755 "\${srcdir}/\${pkgname}-\${pkgver}-\${CARCH}" "\${pkgdir}/usr/bin/git-iris" |
| 49 | +} |
| 50 | +EOF |
| 51 | + |
| 52 | +# Update .SRCINFO |
| 53 | +cat > .SRCINFO << EOF |
| 54 | +pkgbase = git-iris-bin |
| 55 | + pkgdesc = An intelligent agent that understands your code and crafts perfect Git artifacts |
| 56 | + pkgver = ${VERSION_NUM} |
| 57 | + pkgrel = 1 |
| 58 | + url = https://github.com/hyperb1iss/git-iris |
| 59 | + arch = x86_64 |
| 60 | + arch = aarch64 |
| 61 | + license = Apache-2.0 |
| 62 | + provides = git-iris |
| 63 | + conflicts = git-iris |
| 64 | + depends = gcc-libs |
| 65 | + depends = openssl |
| 66 | + source_x86_64 = git-iris-bin-${VERSION_NUM}-x86_64::https://github.com/hyperb1iss/git-iris/releases/download/v${VERSION_NUM}/git-iris-linux-amd64 |
| 67 | + source_aarch64 = git-iris-bin-${VERSION_NUM}-aarch64::https://github.com/hyperb1iss/git-iris/releases/download/v${VERSION_NUM}/git-iris-linux-arm64 |
| 68 | + sha256sums_x86_64 = ${SHA_X86_64} |
| 69 | + sha256sums_aarch64 = ${SHA_AARCH64} |
| 70 | +
|
| 71 | +pkgname = git-iris-bin |
| 72 | +EOF |
| 73 | + |
| 74 | +echo "" |
| 75 | +echo "Updated PKGBUILD and .SRCINFO for ${VERSION}" |
| 76 | +echo "" |
| 77 | +echo "Next steps:" |
| 78 | +echo " 1. Clone the AUR repo (first time only):" |
| 79 | +echo " git clone ssh://[email protected]/git-iris-bin.git ~/dev/aur-git-iris" |
| 80 | +echo "" |
| 81 | +echo " 2. Copy files and push:" |
| 82 | +echo " cp PKGBUILD .SRCINFO ~/dev/aur-git-iris/" |
| 83 | +echo " cd ~/dev/aur-git-iris" |
| 84 | +echo " git add PKGBUILD .SRCINFO" |
| 85 | +echo " git commit -m \"Update to ${VERSION_NUM}\"" |
| 86 | +echo " git push" |
| 87 | +echo "" |
0 commit comments