Skip to content

Support multi-platform distribution for rivetdb using cargo-dist #15

@zfarrell

Description

@zfarrell

Summary

Add automated multi-platform binary distribution for the rivetdb CLI using cargo-dist.
This will allow users to install the binary via Homebrew, .deb, .rpm, or tarball, and will automate releases through GitHub Actions.

This work includes adding cargo-dist configuration, setting up a Homebrew tap, configuring CI, and validating release builds.

Goals

  • Build and publish binaries for:
    • macOS (x86_64 + aarch64)
    • Linux (x86_64 + aarch64)
  • Automatically generate:
    • Homebrew formula (and push to tap repo)
    • .deb and .rpm packages
    • installer shell script
    • tarball artifacts
  • Automatically upload all artifacts to GitHub Releases when tagging a version.
  • Ensure developers can install via:
    brew install rivetdb

Non-Goals

  • Publishing to official apt / yum repositories.
  • Publishing to npm.
  • Windows support (possible future work).

Implementation Plan

1. Add cargo-dist configuration

Create dist/dist.toml:

[workspace]
members = ["rivetdb"]

[package.rivetdb]
dist = true
bin = "rivetdb"

[dist]
features = ["brew", "shell", "github"]
targets = [
  "x86_64-unknown-linux-gnu",
  "aarch64-unknown-linux-gnu",
  "x86_64-apple-darwin",
  "aarch64-apple-darwin"
]
artifacts = ["tarball", "deb", "rpm"]
installers = ["homebrew", "shell"]

[dist.github]
tap = "hotdata-dev/homebrew-tap"
tap-branch = "main"

2. Create Homebrew tap repo

Create public repo: hotdata-dev/homebrew-tap (empty).
cargo-dist will push formula updates here automatically.

3. Add GitHub Actions Workflow

Create .github/workflows/release.yml:

name: Release

on:
  push:
    tags:
      - "v*.*.*"

permissions:
  contents: write
  discussions: write
  packages: write
  id-token: write

jobs:
  dist:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Install cargo-dist
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-dist

      - name: Build & Publish Artifacts
        run: |
          cargo dist build
          cargo dist manifest
          cargo dist publish --github-token "${{ secrets.GITHUB_TOKEN }}"

4. Validate Build Locally

Run:

cargo install cargo-dist
cargo dist build

Verify:

  • all targets build
  • .deb / .rpm generate
  • tarballs contain working binaries
  • installer script exists under dist/

5. Publish First Release

Tag and push:

git tag v0.1.0
git push --tags

This triggers the full build + deploy pipeline.


6. Verify Installation (Against GitHub Releases)

Once a tagged release (e.g. v0.1.0) has been created and the GitHub Action has completed, verify installation using the artifacts from the GitHub Release.

6.1 Homebrew (macOS / Linux)

brew tap hotdata-dev/homebrew-tap
brew install rivetdb
rivetdb --version

rivetdb --version should match the tag version.


6.2 Debian/Ubuntu .deb from GitHub Releases

  1. Go to: https://github.com/hotdata-dev/rivetdb/releases
  2. Open the release for the tag.
  3. Copy the URL of the .deb artifact (e.g. rivetdb_0.1.0_amd64.deb).
VERSION=v0.1.0
DEB_URL="https://github.com/hotdata-dev/rivetdb/releases/download/${VERSION}/<deb-file>.deb"

curl -LO "${DEB_URL}"
sudo apt install ./<deb-file>.deb

rivetdb --version

6.3 RPM (Fedora / RHEL / Amazon Linux)

  1. Go to the release page.
  2. Copy the URL of the .rpm artifact.
VERSION=v0.1.0
RPM_URL="https://github.com/hotdata-dev/rivetdb/releases/download/${VERSION}/<rpm-file>.rpm"

curl -LO "${RPM_URL}"
sudo rpm -i <rpm-file>.rpm

rivetdb --version

6.4 Direct tarball install

VERSION=v0.1.0
TARBALL_URL="https://github.com/hotdata-dev/rivetdb/releases/download/${VERSION}/<tarball>.tar.gz"

curl -LO "${TARBALL_URL}"
tar -xzf <tarball>.tar.gz
sudo mv rivetdb /usr/local/bin/

rivetdb --version

Acceptance Criteria

  • dist/dist.toml created and correct
  • GitHub Actions workflow working
  • Homebrew tap receives auto-generated formula
  • Release artifacts generated:
    • tarballs
    • .deb
    • .rpm
    • installer script
  • Install works via Homebrew
  • Install works via .deb and .rpm
  • Artifacts appear in GitHub Releases

Follow-Up Tickets

  • Windows support via Scoop
  • Nix flake support
  • Official apt/yum repo hosting
  • Binary signing / SLSA provenance

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions