Skip to content

Publish dfetch to Arch Linux AUR #1319

Description

@spoorcc

Goal

Make dfetch installable via the Arch User Repository (AUR) so Arch Linux users can install it with their preferred AUR helper (e.g. yay -S dfetch-bin).

Background

dfetch already builds a self-contained binary via Nuitka and produces an .rpm/.deb on every release (see build.yml). The AUR is the lowest-friction first step into distro packaging because:

  • No build server is needed — the PKGBUILD can reference the pre-built binary from a GitHub Release tarball.
  • The -bin naming convention is well-understood by Arch users.
  • Updates can be fully automated from CI on each release.

Suggested plan

1. Create aur/PKGBUILD

Add an aur/ directory to the repo containing a PKGBUILD for an dfetch-bin package:

# Maintainer: dfetch-org
pkgname=dfetch-bin
pkgver=0.14.2          # updated by CI
pkgrel=1
pkgdesc="Vendor tool for fetching external dependencies"
arch=('x86_64')
url="https://github.com/dfetch-org/dfetch"
license=('MIT')
provides=('dfetch')
conflicts=('dfetch')
source=("https://github.com/dfetch-org/dfetch/releases/download/${pkgver}/dfetch-${pkgver}-nix.tar.gz")
sha256sums=('SKIP')    # replaced by CI with real checksum

package() {
  install -Dm755 dfetch "$pkgdir/usr/bin/dfetch"
}

The exact source URL and archive layout will depend on what's inside the release tarball — adjust once confirmed.

2. Add .SRCINFO

AUR requires a .SRCINFO alongside PKGBUILD. Generate it with makepkg --printsrcinfo > .SRCINFO.

3. Create an AUR SSH deploy key

  • Generate an SSH key pair.
  • Add the public key to the AUR account for dfetch-org.
  • Store the private key as AUR_SSH_KEY in GitHub repo secrets (under an aur environment).

4. Add aur-publish.yml workflow

Trigger on release: [published], skipping the rolling latest tag:

name: Publish to AUR

on:
  release:
    types: [published]
  workflow_dispatch:
    inputs:
      release-tag:
        description: 'Release tag (e.g. 0.14.2)'
        required: true

jobs:
  publish:
    if: >-
      github.event_name != 'release' ||
      github.event.release.tag_name != 'latest'
    runs-on: ubuntu-latest
    environment:
      name: aur
      url: https://aur.archlinux.org/packages/dfetch-bin

    steps:
      - uses: actions/checkout@...

      - name: Update pkgver and checksums
        run: |
          TAG=${{ github.event.release.tag_name || inputs.release-tag }}
          URL="https://github.com/dfetch-org/dfetch/releases/download/${TAG}/dfetch-${TAG}-nix.tar.gz"
          SHA256=$(curl -sL "$URL" | sha256sum | awk '{print $1}')
          sed -i "s/^pkgver=.*/pkgver=${TAG}/" aur/PKGBUILD
          sed -i "s/^sha256sums=.*/sha256sums=('${SHA256}')/" aur/PKGBUILD
          (cd aur && makepkg --printsrcinfo > .SRCINFO)

      - name: Publish to AUR
        uses: KSXGitHub/github-actions-deploy-aur@...
        with:
          pkgname: dfetch-bin
          pkgbuild: ./aur/PKGBUILD
          commit_username: dfetch-bot
          commit_email: bot@dfetch.dev
          ssh_private_key: ${{ secrets.AUR_SSH_KEY }}
          commit_message: "Update to ${{ github.event.release.tag_name || inputs.release-tag }}"

5. Test locally before first publish

cd aur
makepkg -si   # builds and installs locally

Acceptance criteria

  • yay -S dfetch-bin installs a working dfetch binary on Arch Linux
  • The AUR package version is updated automatically on each GitHub Release
  • The workflow is skipped for the rolling latest tag

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions