Skip to content

GitHub Actions & Release Automation - #2

Merged
msetsma merged 20 commits into
mainfrom
feature/QofL
Nov 3, 2025
Merged

msetsma merged 20 commits into
mainfrom
feature/QofL

Conversation

@msetsma

@msetsma msetsma commented Nov 2, 2025

Copy link
Copy Markdown
Owner

Overview

Migrated from cargo-dist to a fully manual, transparent GitHub Actions workflow. Added comprehensive CI/CD pipeline, documentation, and Homebrew automation.

Changes by Category

GitHub Actions Workflows (NEW)

release.yml - Multi-platform release automation (264 lines)

  • 4 jobs: create-release, build (6 platforms), publish, update-homebrew
  • Semantic versioning validation - Tag must match Cargo.toml
  • Draft releases by default - Safe preview before publication
  • Test release support via workflow_dispatch with timestamp-based versions
  • Fully automated Homebrew formula updates with all 4 SHA256 checksums
  • 6 parallel platform builds:
    • Linux x86_64 (GNU libc)
    • Linux x86_64 (musl - fully static)
    • Linux ARM64 (aarch64)
    • macOS x86_64
    • macOS ARM64 (Apple Silicon)
    • Windows x86_64 (MSVC)

tests.yml - CI/CD pipeline (234 lines)

  • Multi-platform testing - Ubuntu/macOS/Windows
  • MSRV testing - Rust 1.70.0 (Minimum Supported Rust Version)
  • Clippy linting - Code quality checks
  • Code formatting - rustfmt validation
  • Security audit - cargo-audit vulnerability scanning
  • Code coverage - tarpaulin with Codecov upload
  • Documentation validation - Warnings treated as errors
  • Scheduled daily runs at 1 AM UTC to catch dependency issues
  • Test results summary - Aggregated job status reporting

Homebrew Integration (NEW)

.github/scripts/update-homebrew.sh - Automated formula updates

  • Clones homebrew-gitnav tap repository using HOMEBREW_TOKEN
  • Copies template from homebrew/gitnav.rb and replaces:
    • VERSION_PLACEHOLDER → actual version from git tag
    • LINUX_GNU_SHA_PLACEHOLDER → Linux x86_64 SHA256
    • LINUX_ARM_SHA_PLACEHOLDER → Linux ARM64 SHA256
    • MACOS_X86_SHA_PLACEHOLDER → macOS x86_64 SHA256
    • MACOS_ARM_SHA_PLACEHOLDER → macOS ARM64 SHA256
  • Commits and pushes changes automatically
  • No manual updates needed - fully automated

homebrew/gitnav.rb - Formula template

  • Supports all 6 platforms (macOS x86_64/ARM64, Linux GNU/ARM64/musl, Windows)
  • Placeholder-based for version and checksums
  • Includes shell integration caveats (zsh, bash, fish, nushell)
  • fzf dependency declaration
  • Automatic binary installation

Documentation (NEW)

  • docs/development/github-workflows.md (722 lines)

    • Comprehensive workflow documentation
    • Job breakdowns and performance metrics
    • Configuration and branch protection rules
    • Debugging and troubleshooting guide
  • docs/development/roadmap.md - Moved and updated from root

  • docs/getting-started/quick-start.md - Quick start guide

  • docs/guides/usage-guide.md (610 lines) - Comprehensive user guide

  • docs/guides/scripting.md (633 lines) - Scripting examples and automation

  • docs/reference/exit-codes.md - Exit code reference

  • docs/reference/performance.md - Performance benchmarks

  • homebrew/README.md - Homebrew integration guide (87 lines)

Source Code Enhancements

  • src/exit_codes.rs (NEW, 84 lines)

    • Standardized exit codes (EXIT_SUCCESS, EXIT_GENERAL_ERROR, etc.)
    • BSD sysexits.h compliance
  • src/output.rs (NEW, 288 lines)

    • Centralized output formatting
    • Support for colors, quiet mode, verbose mode
    • Error/success/warning messages
  • Enhanced modules:

    • src/cache.rs - +417 lines (cache improvements)
    • src/config.rs - +536 lines (config enhancements)
    • src/fzf.rs - +167 lines (fzf integration improvements)
    • src/scanner.rs - +329 lines (scanning improvements)
    • src/preview.rs - +434 lines (preview enhancements)
    • src/main.rs - +266 lines (CLI improvements)
    • src/shell.rs - +55 lines (shell integration)

Configuration & Build

  • Cargo.toml - Added dependencies:

    • serde_json = "1.0" - JSON serialization
    • atty = "0.2" - TTY detection
  • .gitignore - Added .claude/ for development tools

  • README.md - Updated:

    • Added Homebrew installation section
    • Added Nushell shell integration support
    • Listed all supported platforms (Linux x86_64/ARM64/musl, macOS x86_64/ARM64, Windows)
    • Improved installation instructions
  • CHANGELOG.md - Added comprehensive v0.2.0 release notes (109 lines):

    • Phase 1: Critical Fixes
    • Phase 2: High Priority
    • Phase 3: Medium Priority
    • Technical improvements and bug fixes
  • TODO.md (NEW, 149 lines) - Release checklist and process documentation

Key Features

Fully Automated Releases - No manual binary compilation needed
Multi-Platform Builds - 6 platforms in parallel (total ~10-15 min)
Complete Homebrew Automation - All SHA256 checksums populated automatically
Professional CI/CD - Linting, testing, security audits, coverage tracking
Comprehensive Documentation - 2000+ lines of user and developer docs
Zero External Dependencies - Uses only standard Rust tooling
Production-Ready - Follows industry best practices from ripgre

- Add Homebrew installer to dist.toml
- Configure tap URL: msetsma/gitnav
- Enable automatic formula publishing
- Add workflow step to publish formula to tap
- Requires HOMEBREW_GITHUB_TOKEN secret to be set
- Specify cargo-dist version 0.13 explicitly in all jobs
- Add caching for cargo-dist binary to speed up plan job
- Ensures consistent version across plan, build, and publish jobs
- Change version from 0.13 to 0.13.0 (full semantic version)
- Cargo install requires patch version number
- Update cache key to use 0.13.0
- Add host-mode = true to allow cargo dist plan to work
- Fixes error about no targets specified in plan phase
- Host mode will use the current platform for planning
- Remove Homebrew installer from dist.toml (was causing plan phase errors)
- Remove host-mode setting
- Keep standard cargo-dist targets and archives
- Update release workflow to manually extract SHA256 checksums
- Prepare for manual Homebrew formula updates from release artifacts

This fixes the 'no targets specified' error in the plan phase while
keeping release workflow functional.
The plan step was failing because it specified targets but didn't enable
host-mode, causing cargo-dist to fail with 'You specified --artifacts,
disabling host mode, but specified no targets to build!' error. Adding
the --host-mode flag resolves this issue.
The plan step was failing because cargo-dist 0.13.0 doesn't support
--host-mode flag and the targets defined in dist.toml were causing
conflict. Moving target definitions to the build matrix in the workflow
allows plan to run without specifying targets directly.
@msetsma
msetsma merged commit 31e123f into main Nov 3, 2025
24 checks passed
@msetsma
msetsma deleted the feature/QofL branch November 3, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant