Skip to main content

Prerequisites

Before building, ensure you have the following installed:

Go

Version 1.21 or higher
go version

Make

GNU Make (included on most systems)
make --version

FFmpeg

Required for video conversion
ffmpeg -version

ImageMagick

Required for image conversion
magick -version

Quick Start

Clone the Repository

git clone https://github.com/Azilone/Camera-Workflow.git
cd Camera-Workflow

Install Dependencies

make deps
This command downloads and tidies Go module dependencies.

Build the Binary

make build-local
# Output: ./media-converter

Make Targets Reference

The Makefile provides comprehensive build automation. Run make help to see all available targets.

Build Commands

Build the production binary with version information.
make build
Output: ./build/media-converterFeatures:
  • Includes version, commit hash, and build time
  • Optimized for distribution
  • Creates build directory automatically
Build for local development without version info.
make build-local
Output: ./media-converterFeatures:
  • Faster builds (no linker flags)
  • Places binary in project root
  • Ideal for rapid iteration
Install the binary to $GOPATH/bin.
make install
Output: $GOPATH/bin/media-converterFeatures:
  • Makes binary available system-wide
  • Includes version information
  • Requires $GOPATH/bin in your $PATH
Quick development build workflow.
make dev
Runs: cleandepsbuild-localUse case: Start fresh development build
Complete build pipeline.
make all
Runs: cleandepstestbuildUse case: Full validation before release

Cross-Compilation

Camera Workflow supports building for multiple platforms:

Standard Cross-Compile

make cross-compile
Builds for:
  • media-converter-darwin-amd64 (macOS Intel)
  • media-converter-darwin-arm64 (macOS Apple Silicon)
  • media-converter-linux-amd64 (Linux x64)
  • media-converter-linux-arm64 (Linux ARM64)
  • media-converter-windows-amd64.exe (Windows x64)
Output directory: ./build/

Release Binaries

make release-binaries
Builds user-friendly named binaries:
  • media-converter-macos-intel (macOS Intel x64)
  • media-converter-macos-apple-silicon (macOS M1/M2/M3/M4)
  • media-converter-linux-amd64 (Linux x64)
  • media-converter-linux-arm64 (Linux ARM64)
  • media-converter-windows-amd64.exe (Windows x64)
These binaries are ready to upload to GitHub Releases!

Release Preparation

make release-prep
Complete release workflow:
  1. Clean build artifacts
  2. Download dependencies
  3. Run full test suite
  4. Build release binaries

Testing Commands

make test
# Runs all tests with verbose output

Code Quality

Format Go code using go fmt.
make fmt
Formats all .go files in the project.
Run Go vet to find suspicious code.
make vet
Checks for common mistakes and potential issues.
Run all linting tools.
make lint
Runs: fmtvet

Cleanup

make clean
Removes:
  • ./build/ directory
  • ./media-converter binary
  • coverage.out and coverage.html
  • Go build cache

Running the Application

make run
Does:
  1. Builds local binary
  2. Runs with --dry-run --help flags

Raycast Extension

The monorepo includes a Raycast extension for macOS:

Raycast Build Commands

make raycast-binaries
# Builds macOS binaries embedded in Raycast extension

Raycast Development Workflow

# 1. Install Raycast dependencies
make raycast-install

# 2. Build embedded binaries
make raycast-binaries

# 3. Start development
make raycast-dev
Raycast binaries are built with specific version metadata and embedded into the extension bundle.

Build Variables

The Makefile uses the following build variables:
BINARY_NAME=media-converter
BUILD_DIR=./build
RAYCAST_DIR=./apps/raycast

# Version information (auto-detected)
VERSION=$(shell git describe --tags --always --dirty)
COMMIT=$(shell git rev-parse --short HEAD)
BUILD_TIME=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

Custom Version

You can override version information:
make build VERSION=v2.0.0 COMMIT=abc123

Linker Flags

Production builds embed version information using linker flags:
LDFLAGS=-ldflags "-X main.Version=$(VERSION) \
                  -X main.Commit=$(COMMIT) \
                  -X main.BuildTime=$(BUILD_TIME)"
These values are accessible in the binary:
./media-converter --version
# Output: media-converter version v1.0.0 (commit abc123, built 2026-03-03T10:30:00Z)

Build Troubleshooting

If you encounter module errors:
make clean
rm -rf go.sum
make deps
Install required dependencies:macOS:
brew install ffmpeg imagemagick
Ubuntu/Debian:
sudo apt install ffmpeg imagemagick
Arch Linux:
sudo pacman -S ffmpeg imagemagick
Ensure you have the Go toolchain for target platforms:
go install golang.org/dl/go1.21.0@latest
go1.21.0 download
If build output fails with permission errors:
sudo chown -R $USER:$USER ./build
chmod +x ./build/media-converter

Docker Build (Future)

Docker support is planned:
make docker-build
# Builds: media-converter:latest
Docker builds are not yet implemented. This feature is planned for a future release.

Next Steps

Testing

Learn how to run tests and check coverage

Architecture

Understand the system architecture

Contributing

Contribute to the project

Build docs developers (and LLMs) love