Skip to content

Migrate release tooling from cargo-dist to GoReleaser before v0.1 #65

@unclesp1d3r

Description

@unclesp1d3r

Context

Our current release process uses cargo-dist to build and publish releases. While cargo-dist has served us well, we've encountered some friction points that would be resolved by migrating to GoReleaser.

Current State

The cargo-dist configuration includes:

  • Multi-platform builds (Linux x86_64, Linux ARM, macOS, Windows)
  • GitHub Release creation with auto-generated release notes
  • Homebrew formula publishing to EvilBit-Labs/homebrew-tap
  • SBOM generation using cargo-cyclonedx
  • Build attestations for supply chain security
  • Artifact signing and checksums

Problems with Current Approach

  1. Workflow Complexity: The generated .github/workflows/release.yml is over 300 lines and difficult to customize
  2. Actionlint Warnings: The auto-generated workflow consistently triggers actionlint warnings, cluttering our CI output
  3. Limited Flexibility: cargo-dist's opinionated approach makes it challenging to customize the release process
  4. Maintenance Burden: Need to keep cargo-dist installation scripts in sync across multiple workflow files (security.yml, copilot-setup-steps.yml)

Why GoReleaser?

  1. Better Rust Support: GoReleaser now has official Rust/Cargo support with good cross-compilation capabilities
  2. More Mature Ecosystem: Extensive plugin system and well-documented customization options
  3. Cleaner Configuration: YAML-based config is easier to understand and maintain than generated workflows
  4. Flexible: Easier to customize release behavior, artifacts, and publishing strategies
  5. No Generated Workflows: Uses a single reusable action, avoiding actionlint issues
  6. Rich Feature Set: Built-in support for Docker, Snapcraft, AUR, and many other distribution channels

Proposed Solution

Phase 1: Setup GoReleaser Configuration

  1. Create .goreleaser.yml configuration file with:
    • Rust build configuration for all target platforms
    • Archive generation matching current artifact structure
    • Checksum generation
    • GitHub Release publishing

Phase 2: Migrate Publishing Targets

  1. Homebrew: Configure GoReleaser's Homebrew tap publisher
    • Target: EvilBit-Labs/homebrew-tap
    • Ensure formula matches current structure
  2. SBOM Generation: Integrate SBOM generation (cargo-cyclonedx or built-in)
  3. Attestations: Configure artifact signing and attestations

Phase 3: Update CI/CD

  1. Replace .github/workflows/release.yml with minimal GoReleaser workflow
  2. Remove cargo-dist installation from:
    • security.yml
    • copilot-setup-steps.yml
  3. Update any documentation referencing cargo-dist

Phase 4: Testing & Validation

  1. Test release process with pre-release tag
  2. Verify all artifacts are generated correctly
  3. Confirm Homebrew formula updates work
  4. Validate checksums and signatures
  5. Test installation on all supported platforms

Success Criteria

  • GoReleaser configuration successfully builds all current platforms
  • GitHub Releases match current format and content
  • Homebrew tap updates automatically
  • SBOMs are generated for all artifacts
  • Attestations/signatures work correctly
  • Release workflow is under 100 lines
  • No actionlint warnings
  • Successfully complete a test release

References

Timeline

This migration should be completed before releasing v0.1, as changing release tooling after the first major release would be more disruptive to users who may have automated installations.

Metadata

Metadata

Assignees

Labels

MVPMinimum viable product featuresenhancementNew feature or requestgithub_actionsPull requests that update GitHub Actions codepriority:highHigh priority task

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions