Skip to content

Release: Set up cargo-dist for automated builds & installers #67

@alvinreal

Description

@alvinreal

Overview

Set up cargo-dist (now called dist) to handle the entire release pipeline automatically. This replaces the need for hand-written release workflows, install scripts, and package manager manifests.

What cargo-dist does for us (out of the box)

  • Generates .github/workflows/release.yml automatically
  • Builds optimized binaries for all platforms (Linux x86_64/ARM64, macOS Intel/Apple Silicon, Windows)
  • Creates tarballs/zips with correct permissions
  • Generates SHA256 checksums
  • Creates GitHub Releases with changelogs
  • Generates install.sh (curl | sh) and install.ps1 (irm | iex) installers
  • Homebrew formula generation
  • npm installer package (for npx morph)
  • Windows MSI installer
  • Supports cargo-binstall out of the box

Setup steps

  1. Install dist: cargo install cargo-dist
  2. Run dist init --yes in the morph repo
  3. Review generated config in Cargo.toml under [workspace.metadata.dist]
  4. Enable desired installers: dist init (interactive — select shell, powershell, homebrew, npm, msi)
  5. Test locally with dist build and dist plan
  6. Commit generated release.yml
  7. Test on a PR (plan step runs automatically)

Installers to enable

  • Shell script (curl | sh)
  • PowerShell script (irm | iex)
  • Homebrew formula
  • npm package (optional — enables npx morph)
  • MSI installer (optional — Windows GUI installer)

Build targets

  • x86_64-unknown-linux-gnu
  • x86_64-unknown-linux-musl
  • aarch64-unknown-linux-gnu
  • x86_64-apple-darwin
  • aarch64-apple-darwin
  • x86_64-pc-windows-msvc

Acceptance

  • dist plan shows correct build matrix
  • dist build produces working binary for current platform
  • PR CI runs plan step successfully
  • Tag push triggers full release workflow

Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraCI/CD and project infra

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions