obm/CONTRIBUTING.md
MermaidMan d080e107d0 feat: add cross-compile and release pipeline
- Enhanced Makefile with cross-compilation for linux/amd64, linux/arm64,
  darwin/arm64, windows/amd64, windows/arm64
- Added GitHub Actions CI workflow for testing on all platforms
- Added GitHub Actions Release workflow triggered by version tags
- Added VERSION file for version tracking
- Added scripts/release.sh for automated release process
- Added Dockerfile for containerized builds
- Added CONTRIBUTING.md with release process documentation
- Added CHANGELOG.md for version tracking
- Updated .gitignore to exclude build artifacts
- Fixed unused variable in cmd/obm/main.go
- Version now injected via ldflags (main.version, main.gitCommit, main.buildTime)
2026-05-22 15:38:55 +00:00

2.7 KiB

Contributing to OpenBoatMobile CLI

Development Setup

Prerequisites

  • Go 1.22 or later
  • Make (optional, for using Makefile targets)
  • Git

Getting Started

# Clone the repository
git clone https://github.com/openboatmobile/obm.git
cd obm

# Install dependencies
go mod download

# Build
make build

# Run tests
make test

# Run locally
./obm --help

Build Commands

# Quick build (current platform)
make build

# Run tests with race detection
make test

# Run linter
make lint

# Format code
make fmt

# Cross-compile all platforms
make cross-compile

# Prepare release artifacts
make prepare-release VERSION=0.2.0

Release Process

Releases are automated via GitHub Actions.

Creating a Release

  1. Update VERSION file:

    echo "0.2.0" > VERSION
    
  2. Run the release script (recommended):

    ./scripts/release.sh v0.2.0
    

    This will:

    • Validate version format
    • Run tests
    • Update VERSION file
    • Commit the version bump
    • Create and push the tag
    • Trigger GitHub Actions release workflow
  3. Manual release (alternative):

    # Update VERSION
    echo "0.2.0" > VERSION
    
    # Commit
    git add VERSION
    git commit -m "chore: release v0.2.0"
    
    # Tag
    git tag -a v0.2.0 -m "Release v0.2.0"
    
    # Push tag
    git push origin v0.2.0
    

What Happens When a Tag is Pushed?

GitHub Actions automatically:

  1. Builds binaries for all platforms (Linux amd64/arm64, macOS arm64, Windows amd64/arm64)
  2. Creates archives (.tar.gz for Unix, .zip for Windows)
  3. Generates SHA256 checksums
  4. Creates a GitHub Release with download links

Pre-release Versions

Versions with a hyphen (e.g., v1.0.0-beta.1) are marked as pre-release.

Architecture

cmd/obm/           - CLI entry point and command handlers
internal/
  config/          - Configuration parsing and validation
  deploy/          - Deployment wizard orchestration
  destroy/         - Infrastructure teardown
  inference/       - Inference provider client (ZAI, Venice, OpenRouter)
  prompt/          - Interactive terminal prompts
  provider/        - Cloud provider interfaces (Hetzner, DigitalOcean)
  ssh/             - SSH client for remote execution
  step/            - Deployment steps (Tailscale, Discord)
  terraform/       - Terraform wrapper
  validation/       - Configuration validation framework

Testing

  • Run make test for full test suite with race detection
  • Run make quick-test for faster iteration (no race detection)
  • Run make coverage to generate HTML coverage report

Pull Request Checklist

  • Tests pass (make test)
  • Code is formatted (make fmt)
  • Vet passes (make vet)
  • New code has tests
  • Documentation updated if needed