From 2af1d218c6171db177cba66221a89086583e4fd7 Mon Sep 17 00:00:00 2001 From: Said Boudjelda Date: Sun, 15 Nov 2026 17:13:24 +0100 Subject: [PATCH] feat(release): ship the CLI as .deb, .rpm and .apk packages Each linux build in release.yml now runs nfpm (cli/nfpm.yaml) on the same binary the tarball holds, and the GitHub Release carries kates-linux-.deb, .rpm and .apk with build provenance and entries in checksums.txt. The names follow the tarballs, so /releases/latest/download/kates-linux-amd64.deb always resolves and pre-release versions never put a ~ in a file name. The packages install kates in /usr/bin and LICENSE in /usr/share/doc/kates, as a plain file so dnf's nodocs keeps it. The release notes, the README and the CLI reference's Installation section say how to install them. --- .github/release-body.md.tmpl | 11 +++++++++++ .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++++++--- README.md | 2 +- cli/nfpm.yaml | 25 +++++++++++++++++++++++++ docs/book/10-cli-reference.md | 13 ++++++++++++- 5 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 cli/nfpm.yaml diff --git a/.github/release-body.md.tmpl b/.github/release-body.md.tmpl index 3ec83b4f3..6557ca2fe 100644 --- a/.github/release-body.md.tmpl +++ b/.github/release-body.md.tmpl @@ -55,6 +55,17 @@ steps: # Homebrew (macOS & Linux) brew install bmscomp/tap/kates +# Debian / Ubuntu +curl -fsSLO https://github.com/bmscomp/kates/releases/download/__TAG__/kates-linux-$(dpkg --print-architecture).deb +sudo apt install ./kates-linux-$(dpkg --print-architecture).deb + +# Fedora / RHEL +sudo dnf install https://github.com/bmscomp/kates/releases/download/__TAG__/kates-linux-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').rpm + +# Alpine (the package is unsigned) +curl -fsSLO https://github.com/bmscomp/kates/releases/download/__TAG__/kates-linux-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').apk +apk add --allow-untrusted ./kates-linux-*.apk + # Direct binary archive (__TAG__) curl -fsSL https://github.com/bmscomp/kates/releases/download/__TAG__/kates-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz | tar -xz ``` diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5bb293c45..6669821fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,13 +108,39 @@ jobs: with: subject-path: cli/kates-${{ matrix.os }}-${{ matrix.arch }}.tar.gz + # The same binary as a .deb, .rpm and .apk (cli/nfpm.yaml), named like + # the tarball so /releases/latest/download/kates-linux-amd64.deb always + # resolves; nfpm's own names put a ~ in pre-release versions. + - name: Package deb, rpm and apk + if: matrix.os == 'linux' + working-directory: cli + env: + NFPM_VERSION: v2.48.0 + run: | + GOBIN="${RUNNER_TEMP}/bin" go install "github.com/goreleaser/nfpm/v2/cmd/nfpm@${NFPM_VERSION}" + for packager in deb rpm apk; do + PACKAGE="kates-linux-${{ matrix.arch }}.${packager}" + ARCH="${{ matrix.arch }}" VERSION="${GITHUB_REF_NAME#v}" \ + "${RUNNER_TEMP}/bin/nfpm" package --config nfpm.yaml --packager "${packager}" --target "${PACKAGE}" + shasum -a 256 "${PACKAGE}" > "${PACKAGE}.sha256" + done + + - name: Attest package provenance + if: matrix.os == 'linux' + uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: | + cli/kates-linux-${{ matrix.arch }}.deb + cli/kates-linux-${{ matrix.arch }}.rpm + cli/kates-linux-${{ matrix.arch }}.apk + - name: Upload artifact uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: kates-${{ matrix.os }}-${{ matrix.arch }} - path: | - cli/kates-${{ matrix.os }}-${{ matrix.arch }}.tar.gz - cli/kates-${{ matrix.os }}-${{ matrix.arch }}.tar.gz.sha256 + # The tarball, on linux the packages, and each one's .sha256. + path: cli/kates-${{ matrix.os }}-${{ matrix.arch }}.* + if-no-files-found: error editor-extensions: name: Package Editor Extensions @@ -277,6 +303,9 @@ jobs: generate_release_notes: true files: | dist/kates-*.tar.gz + dist/kates-linux-*.deb + dist/kates-linux-*.rpm + dist/kates-linux-*.apk dist/vscode-kates-*.vsix dist/visualstudio-kates-*.zip dist/checksums.txt diff --git a/README.md b/README.md index b1311ae60..f1c694ded 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Without Homebrew on Linux, install Docker Engine, Kind, kubectl and Helm from th curl -fsSL https://raw.githubusercontent.com/bmscomp/kates/main/scripts/install-kates.sh | bash ``` -Or download `kates--.tar.gz` from the [latest release](https://github.com/bmscomp/kates/releases/latest): it holds a single `kates` binary. Install [cosign](https://docs.sigstore.dev/cosign/system_config/installation/) too, so `kates deploy` can check the signatures of the charts it pulls. +Or download `kates--.tar.gz` from the [latest release](https://github.com/bmscomp/kates/releases/latest): it holds a single `kates` binary. On Debian, Ubuntu, Fedora or Alpine, the same release has `kates-linux-.deb`, `.rpm` and `.apk` packages (`sudo apt install ./kates-linux-amd64.deb`); see [Installation](docs/book/10-cli-reference.md#installation). Install [cosign](https://docs.sigstore.dev/cosign/system_config/installation/) too, so `kates deploy` can check the signatures of the charts it pulls. Run a CI quality gate against a minimum grade: diff --git a/cli/nfpm.yaml b/cli/nfpm.yaml new file mode 100644 index 000000000..3abb42849 --- /dev/null +++ b/cli/nfpm.yaml @@ -0,0 +1,25 @@ +# The .deb, .rpm and .apk of the release binary. release.yml runs +# `nfpm package` with this file once per packager for each linux build, in +# cli/ where the tarball step leaves kates and LICENSE. +name: kates +arch: ${ARCH} +platform: linux +version: ${VERSION} +version_schema: semver +section: utils +priority: optional +maintainer: bmscomp +description: | + Benchmark, fault-test and audit Apache Kafka clusters on Kubernetes. + Kates deploys Strimzi Kafka, runs benchmark workloads and fault + injections, and grades the results against A-F SLA gates. +vendor: bmscomp +homepage: https://github.com/bmscomp/kates +license: Apache-2.0 +contents: + - src: ./kates + dst: /usr/bin/kates + file_info: + mode: 0755 + - src: ./LICENSE + dst: /usr/share/doc/kates/LICENSE diff --git a/docs/book/10-cli-reference.md b/docs/book/10-cli-reference.md index 3f845175e..dbf9c4598 100644 --- a/docs/book/10-cli-reference.md +++ b/docs/book/10-cli-reference.md @@ -21,7 +21,7 @@ Example IDs, such as `3f8a2c1e`, have the eight hexadecimal characters the Kates ## Installation -The CLI is one binary, released for macOS and Linux on amd64 and arm64. Install a release in one of three ways: +The CLI is one binary, released for macOS and Linux on amd64 and arm64. Install a release in one of four ways: - With Homebrew, on macOS or Linux: `brew install bmscomp/tap/kates`, which also installs cosign. `brew upgrade bmscomp/tap/kates` moves to a newer release. - With the release installer, which downloads the archive for your platform, checks it against the release's `checksums.txt` and puts `kates` in `/usr/local/bin` (`INSTALL_DIR` changes it): @@ -33,6 +33,17 @@ The CLI is one binary, released for macOS and Linux on amd64 and arm64. Install ``` - From the [GitHub Release](https://github.com/bmscomp/kates/releases/latest), by downloading `kates--.tar.gz` and putting the `kates` it holds on your `PATH`. +- On Linux, as a package from the same release: `kates-linux-.deb`, `.rpm` or `.apk`, which puts `kates` in `/usr/bin` and lets the package manager remove it. The packages come from no apt or dnf repository, so `apt upgrade` does not see a new release: install it the same way. + + ```bash + latest=https://github.com/bmscomp/kates/releases/latest/download + # Debian, Ubuntu + curl -fsSLO "${latest}/kates-linux-$(dpkg --print-architecture).deb" + sudo apt install ./kates-linux-*.deb + # Fedora, RHEL + sudo dnf install \ + "${latest}/kates-linux-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').rpm" + ``` Without Homebrew, install [cosign](https://docs.sigstore.dev/cosign/system_config/installation/) as well, so `kates deploy` can check the charts it pulls. To deploy the lab, the CLI also needs Docker, Kind, kubectl and Helm: [Prerequisites](12-deployment.md#prerequisites) in the Deployment Guide lists them.