From 3bf28d88e08b7cc63fbe6ff05e4dc87f564e0091 Mon Sep 17 00:00:00 2001 From: Rian Stockbower <7378790+rianjs@users.noreply.github.com> Date: Sun, 4 Oct 2026 17:39:53 -0400 Subject: [PATCH] feat: publish native Arch Linux packages --- .github/workflows/arch-package.yml | 89 ++++++++++++++++++++++++++++++ .github/workflows/auto-release.yml | 1 + .goreleaser.yml | 3 + README.md | 4 ++ 4 files changed, 97 insertions(+) create mode 100644 .github/workflows/arch-package.yml diff --git a/.github/workflows/arch-package.yml b/.github/workflows/arch-package.yml new file mode 100644 index 0000000..4393525 --- /dev/null +++ b/.github/workflows/arch-package.yml @@ -0,0 +1,89 @@ +name: Arch package + +on: + pull_request: + paths: + - .goreleaser.yml + - .github/workflows/arch-package.yml + workflow_dispatch: + +permissions: + contents: read + +jobs: + package: + runs-on: macos-15 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + include: + - package: nrq + binary: nrq + config: .goreleaser.yml + go-mod: go.mod + steps: + - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 + with: + fetch-depth: 0 + - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 + with: + go-version-file: ${{ matrix.go-mod }} + - uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3 + with: + version: v2.18.2 + args: release --snapshot --clean --skip=before --config ${{ matrix.config }} + - name: Verify both Arch architectures were rendered + shell: bash + run: | + set -euo pipefail + for arch in amd64 arm64; do + packages=(dist/*"${arch}.pkg.tar.zst") + test "${#packages[@]}" -eq 1 + test -f "${packages[0]}" + done + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: arch-${{ matrix.package }} + path: dist/*.pkg.tar.zst + if-no-files-found: error + + install: + needs: package + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + include: + - package: nrq + binary: nrq + config: .goreleaser.yml + go-mod: go.mod + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: arch-${{ matrix.package }} + path: packages + - name: Install, verify and remove in Arch Linux + env: + PACKAGE: ${{ matrix.package }} + BINARY: ${{ matrix.binary }} + shell: bash + run: | + set -euo pipefail + docker run --rm -e PACKAGE -e BINARY -v "$PWD/packages:/packages:ro" archlinux:base bash -c ' + set -euo pipefail + package=(/packages/*amd64.pkg.tar.zst) + test "${#package[@]}" -eq 1 + pacman -U --noconfirm "${package[0]}" + "$BINARY" --version + "$BINARY" --help > /tmp/cli-help + test -s /tmp/cli-help + pacman -Qo "/usr/bin/$BINARY" + pacman -Qkk "$PACKAGE" + pacman -R --noconfirm "$PACKAGE" + test ! -e "/usr/bin/$BINARY" + pacman -U --noconfirm "${package[0]}" + "$BINARY" --version + ' diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 0082073..35f6b7a 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -24,6 +24,7 @@ jobs: auto-release: uses: open-cli-collective/.github/.github/workflows/auto-release.yml@v1 with: + release-paths: "**.go,go.mod,go.sum,version.txt,.goreleaser.yml" # push is live (false); workflow_dispatch honors the checkbox. Compare # against both true and 'true' because a workflow_dispatch boolean input # may surface as a real boolean or the string "true" depending on context diff --git a/.goreleaser.yml b/.goreleaser.yml index 766076c..d8b1384 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -99,6 +99,9 @@ nfpms: formats: - deb - rpm + - archlinux + # Keep tar entry timestamps aligned with pacman integrity metadata. + mtime: "{{ .CommitDate }}" bindir: /usr/bin contents: - src: LICENSE diff --git a/README.md b/README.md index bd487d7..249fed4 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,10 @@ sudo rpm -i nrq-VERSION.x86_64.rpm go install github.com/open-cli-collective/newrelic-cli/cmd/nrq@latest ``` +### Arch Linux / Omarchy + +Add the signed [Open CLI Collective pacman repository](https://github.com/open-cli-collective/linux-packages#arch-linux-pacman) once. Native Arch packages are published with new releases and updated by `sudo pacman -Syu`. Install with `sudo pacman -Syu nrq`; executable names remain unchanged. + ## Quick Start ```bash