ci: aur sources (#378)

Carlos Alexandro Becker created

* ci: aur sources

so users can install from source as well.

* Update .goreleaser.yml

* chore: go mod tidy

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: updates

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Change summary

.goreleaser.yml | 41 +++++++++++++++++++++++++++++++++++++++++
go.sum          |  2 --
2 files changed, 41 insertions(+), 2 deletions(-)

Detailed changes

.goreleaser.yml 🔗

@@ -15,6 +15,7 @@ metadata:
   description: "A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal."
   maintainers:
     - "kujtimiihoxha <kujtim@charm.sh>"
+    - "caarlos0 <carlos@charm.sh>" # for aur
 
 nightly:
   publish_release: true
@@ -82,6 +83,46 @@ archives:
 checksum:
   name_template: "checksums.txt"
 
+aur_sources:
+  - private_key: "{{ .Env.AUR_KEY }}"
+    git_url: "ssh://aur@aur.archlinux.org/crush.git"
+    makedepends:
+      - go
+      - git
+    prepare: |-
+      go mod download
+    build: |-
+      mkdir completions
+      mkdir manpages
+      export CGO_CPPFLAGS="${CPPFLAGS}"
+      export CGO_CFLAGS="${CFLAGS}"
+      export CGO_CXXFLAGS="${CXXFLAGS}"
+      export CGO_LDFLAGS="${LDFLAGS}"
+      export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
+      go build -ldflags="-w -s -buildid='' -linkmode=external -X main.version=v${pkgver}" .
+      ./crush completion bash >./completions/crush.bash
+      ./crush completion zsh >./completions/crush.zsh
+      ./crush completion fish >./completions/crush.fish
+      ./crush man | gzip -c >./manpages/crush.1.gz
+    package: |-
+      # bin
+      install -Dm755 "./crush" "${pkgdir}/usr/bin/crush"
+      # license
+      mkdir -p "${pkgdir}/usr/share/licenses/crush/"
+      install -Dm644 ./LICENSE* "${pkgdir}/usr/share/licenses/crush/"
+      # completions
+      mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
+      mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
+      mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
+      install -Dm644 "./completions/crush.bash" "${pkgdir}/usr/share/bash-completion/completions/crush"
+      install -Dm644 "./completions/crush.zsh" "${pkgdir}/usr/share/zsh/site-functions/_crush"
+      install -Dm644 "./completions/crush.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/crush.fish"
+      # man pages
+      install -Dm644 "./manpages/crush.1.gz" "${pkgdir}/usr/share/man/man1/crush.1.gz"
+      # readme
+      mkdir -pv "${pkgdir}/usr/share/doc/crush/"
+      install -Dm644 README* "${pkgdir}/usr/share/doc/crush/"
+
 aurs:
   - private_key: "{{ .Env.AUR_KEY }}"
     git_url: "ssh://aur@aur.archlinux.org/crush-bin.git"

go.sum 🔗

@@ -74,8 +74,6 @@ github.com/charlievieth/fastwalk v1.0.11 h1:5sLT/q9+d9xMdpKExawLppqvXFZCVKf6JHnr
 github.com/charlievieth/fastwalk v1.0.11/go.mod h1:yGy1zbxog41ZVMcKA/i8ojXLFsuayX5VvwhQVoj9PBI=
 github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250716191546-1e2ffbbcf5c5 h1:GTcMIfDQJKyNKS+xVt7GkNIwz+tBuQtIuiP50WpzNgs=
 github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250716191546-1e2ffbbcf5c5/go.mod h1:6HamsBKWqEC/FVHuQMHgQL+knPyvHH55HwJDHl/adMw=
-github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.4.0.20250724172607-5ba56e2bec69 h1:nXLMl4ows2qogDXhuEtDNgFNXQiU+PJer+UEBsQZuns=
-github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.4.0.20250724172607-5ba56e2bec69/go.mod h1:XIQ1qQfRph6Z5o2EikCydjumo0oDInQySRHuPATzbZc=
 github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.4.0.20250730165737-56ff7146d52d h1:YMXLZHSo8DjytVY/b5dK8LDuyQsVUmBK3ydQMpu2Ui4=
 github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.4.0.20250730165737-56ff7146d52d/go.mod h1:XIQ1qQfRph6Z5o2EikCydjumo0oDInQySRHuPATzbZc=
 github.com/charmbracelet/catwalk v0.3.5 h1:ChMvA5ooTNZhDKFagmGNQgIZvZp8XjpdaJ+cDmhgCgA=