# ๐ฆ Release & Distribution Guide for `batless`
> Complete guide for packaging, releasing, and distributing batless following Rust ecosystem best practices.
[](https://crates.io/crates/batless)
[](https://crates.io/crates/batless)
## ๐ฏ Distribution Overview
**batless** supports multiple distribution channels:
- ๐ฆ **crates.io** - Primary Rust package registry
- ๐ท๏ธ **GitHub Releases** - Cross-platform binaries with automated builds
- ๐บ **Homebrew** - macOS package manager integration
- ๐ง **Linux packages** - .deb, .rpm, and Arch AUR support
- ๐ช **Windows** - Chocolatey and Scoop package managers
- ๐ณ **Docker** - Containerized distribution
---
## ๐ Quick Start for Maintainers
### Prerequisites
```bash
# Install required tools
cargo install cargo-release cargo-audit
# Verify tools
cargo release --version
```
### One-Time Setup
```bash
# 1. Setup release automation
# This project uses GitHub Actions for releases, no additional setup needed
# 2. Configure release automation
cargo dist generate-ci
# 3. Commit configuration
git add .
git commit -m "Configure release automation"
```
---
## ๐ Release Process
### Method 1: Automated Release (Recommended)
```bash
# Use our release script (creates PR for review)
./scripts/release.sh 0.2.0
# Or use cargo-release for direct release
cargo release --execute 0.2.0
```
### Method 2: Manual Release
```bash
# 1. Update version and changelog
./scripts/prep-release.sh 0.2.0
# 2. Review changes and commit
git add .
git commit -m "Release v0.2.0"
# 3. Create and push tag
git tag v0.2.0
git push origin v0.2.0
# 4. GitHub Actions automatically handles the rest
```
### What Happens on Release
1. ๐งช **CI Pipeline** runs full test suite across platforms
2. ๐จ **Cross-compilation** builds binaries for all targets
3. ๐ฆ **Package Creation** generates .deb, .rpm, .msi installers
4. ๐ท๏ธ **GitHub Release** created with binaries and checksums
5. ๐ **crates.io** package published automatically
6. ๐บ **Homebrew** formula updated in tap repository
7. ๐ณ **Docker** images built and pushed to registries
---
## ๐ฏ Supported Platforms
### Primary Targets (Tier 1)
| Linux | x86_64 | .deb, .rpm, .tar.gz | โ
Full support |
| macOS | x86_64, ARM64 | Homebrew, .pkg | โ
Full support |
| Windows | x86_64 | .msi, .zip | โ
Full support |
### Additional Targets (Tier 2)
| Linux | ARM64 | .tar.gz | โ
Binary only |
| Linux | ARMv7 | .tar.gz | โ
Binary only |
| FreeBSD | x86_64 | .tar.gz | โ ๏ธ Best effort |
### Container Support
| Docker Hub | `batless/batless:latest` | ~8MB | โ
Available |
| GHCR | `ghcr.io/owner/batless:latest` | ~8MB | โ
Available |
---
## ๐ Installation Methods for Users
### ๐ฆ Rust Users (Primary)
```bash
# Install from crates.io
cargo install batless
# Install specific version
cargo install batless --version 0.1.0
# Install from git (development)
cargo install --git https://github.com/username/batless
```
### ๐บ macOS (Homebrew)
```bash
# Add our tap (one-time setup)
brew tap docdyhr/batless
# Install batless
brew install batless
# Or install directly without adding tap
brew install docdyhr/batless
```
### ๐ง Linux Package Managers
```bash
# Ubuntu/Debian (.deb)
wget https://github.com/username/batless/releases/latest/download/batless_0.1.0_amd64.deb
sudo dpkg -i batless_0.1.0_amd64.deb
# RHEL/Fedora (.rpm)
wget https://github.com/username/batless/releases/latest/download/batless-0.1.0-1.x86_64.rpm
sudo rpm -i batless-0.1.0-1.x86_64.rpm
# Arch Linux (AUR)
yay -S batless
# or
paru -S batless
```
### ๐ช Windows Package Managers
```powershell
# Chocolatey
choco install batless
# Scoop
scoop bucket add extras
scoop install batless
# winget
winget install batless
```
### ๐ณ Docker
```bash
# Run batless in container
docker run --rm -v $(pwd):/workspace batless/batless /workspace/src/main.rs
# Use as base image
FROM batless/batless:alpine
COPY . /app
WORKDIR /app
RUN batless --mode=summary src/main.rs
```
---
## ๐ Security & Integrity
### Binary Signing
```bash
# Sign release binaries (maintainers)
cargo dist sign --all
# Users can verify signatures
cosign verify-blob \
--certificate-identity-regexp ".*" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
--bundle batless-0.1.0.cosign.bundle \
batless-x86_64-unknown-linux-gnu.tar.gz
```
### Checksums & SBOM
```bash
# Verify download integrity
sha256sum -c batless-0.1.0-checksums.txt
# Check software bill of materials
### Supply Chain Security
- ๐ **Reproducible builds** - deterministic compilation
- ๐ **SBOM generation** - complete dependency tracking
- ๐ **Keyless signing** - GitHub OIDC with Sigstore
- ๐ก๏ธ **Audit pipeline** - cargo-audit on every build
- ๐ท๏ธ **Provenance** - SLSA Level 3 attestations
---
## ๐งช Testing Releases
### Local Testing
```bash
# Test debug build
cargo run -- src/main.rs
# Test release build
cargo build --release
./target/release/batless --version
./target/release/batless --help
# Test all platforms (requires Docker)
cargo dist build --all-targets
```
### Pre-Release Testing
```bash
# Test release process without publishing
cargo dist plan
cargo dist build
cargo dist check
# Test package installation
./scripts/test-packages.sh
```
### Integration Testing
```bash
# Test CLI behavior across platforms
cargo test --test integration_tests
# Test package managers (requires containers)
docker run -it ubuntu:latest bash -c "
wget -O batless.deb https://github.com/.../batless_0.1.0_amd64.deb &&
dpkg -i batless.deb &&
batless --version
"
```
---
## ๐ Distribution Matrix
| **cargo install** | Rust developers | Latest features, easy updates | Requires Rust toolchain |
| **GitHub Releases** | CI/CD, automation | No dependencies, all platforms | Manual updates |
| **Homebrew** | macOS users | System integration, auto-updates | macOS only |
| **Linux packages** | System admins | Package manager integration | Platform-specific |
| **Docker** | Containerized workflows | Isolated, reproducible | Container overhead |
| **Windows packages** | Windows users | System integration | Platform-specific |
## ๐ฏ Release Strategy
### Version Numbering
- **Major** (1.0.0): Breaking API changes, major features
- **Minor** (0.1.0): New features, backwards compatible
- **Patch** (0.0.1): Bug fixes, documentation
### Release Cadence
- ๐ **Major releases**: Every 6-12 months
- โจ **Minor releases**: Monthly or when features are ready
- ๐ **Patch releases**: As needed for critical bugs
- ๐ง **Pre-releases**: Alpha/beta for testing major changes
### LTS Strategy
- **Current**: Latest stable with active development
- **Maintenance**: Previous major with security fixes
- **EOL**: Clear deprecation timeline
---
## ๐ง Maintenance Tasks
### Regular Maintenance
```bash
# Update dependencies (monthly)
cargo update
cargo audit
cargo outdated
# Update CI/CD (quarterly)
act -j test # Test GitHub Actions locally
dependabot alerts # Review security updates
# Performance benchmarks (per release)
cargo bench
hyperfine 'batless large-file.py' 'bat large-file.py'
```
### Security Response
```bash
# Emergency security release
cargo audit
cargo release patch --execute # Immediate patch
./scripts/notify-security.sh # Alert users
```
## ๐ References & Tools
### Core Tools
- ๐ GitHub Actions - Cross-platform distribution and releases
- ๐ [cargo-release](https://github.com/crate-ci/cargo-release) - Release automation
- ๐ [cargo-audit](https://github.com/RustSec/rustsec/tree/main/cargo-audit) - Security auditing
### Package Managers
- ๐บ [Homebrew Tap Guide](https://docs.brew.sh/Taps)
- ๐ง [Debian Packaging](https://www.debian.org/doc/debian-policy/)
- ๐ช [Chocolatey Packages](https://docs.chocolatey.org/en-us/create/create-packages)
### Security & Compliance
- ๐ [Sigstore](https://docs.sigstore.dev/) - Keyless code signing
- ๐ [SLSA](https://slsa.dev/) - Supply chain security framework
- ๐ก๏ธ [OSSF Scorecard](https://github.com/ossf/scorecard) - Security best practices
### CI/CD
- โก [GitHub Actions](https://docs.github.com/en/actions)
- ๐งช [act](https://github.com/nektos/act) - Local GitHub Actions testing
- ๐ญ [release-please](https://github.com/googleapis/release-please) - Automated releases