bold-brew/Makefile
Vito Castellano 6c80585431
chore: release version 2.0.0 - Cask support and XDG compliance (#30)
* feat: add leaves filter to show explicitly installed packages (#25)

Add new filter [L] to display only "leaf" packages - those installed
explicitly by the user and not as dependencies of other packages.

* refactor: Migrate to Podman with OCI Containerfile and enhanced Makefile (#26)

* refactor: migrate from Docker to Podman with OCI Containerfile

Replace Docker with Podman for better security and OCI compliance.
Switch from Dockerfile to standard Containerfile format.

* chore: upgrade Go from 1.24 to 1.25

Update Go version to 1.25 to support latest goreleaser v2 and benefit from improved performance and language features.

* refactor: migrate to Podman and enhance Makefile

Replace Docker with Podman and upgrade Makefile with help system and new developer-friendly targets.

* chore: upgrade to Go 1.25 and golangci-lint v2.5.0

Update Go to 1.25 and golangci-lint to v2.5.0 for better tooling support.

* feat: add security scanning with govulncheck and gosec (#27)

Add comprehensive security scanning to the project with vulnerability checks and static analysis tools.

* feat: Add complete Casks support with unified UI (#28)

* feat(cask): add backend support for Homebrew casks

Implement complete backend infrastructure for managing Homebrew casks alongside formulae, preparing for unified UI.

* feat(cask): add complete Homebrew casks support with unified UI

Implement full backend and UI support for managing Homebrew casks alongside formulae in a unified interface.

* fix(cask): parse cask analytics correctly

Fix cask analytics not being displayed (showing 0 for all casks).

* feat(cask): add complete Homebrew casks support with unified UI

Implement full backend and UI support for managing Homebrew casks alongside formulae in a unified interface.

* fix: create copy to avoid implicit memory aliasing

* feat: implement XDG Base Directory Specification with github.com/adrg/xdg (#29)

Implement XDG Base Directory Specification using the github.com/adrg/xdg package for robust cross-platform support.
2025-10-13 21:26:18 +02:00

148 lines
4 KiB
Makefile

##############################
# VARIABLES
##############################
# Load .env if exists (loaded first so defaults can override if not set)
-include .env
# Default values (can be overridden by .env or command line)
APP_NAME ?= bbrew
APP_VERSION ?= 0.0.1-local
CONTAINER_IMAGE_NAME ?= bbrew
BUILD_GOVERSION ?= 1.25
BUILD_GOOS ?= $(shell go env GOOS)
BUILD_GOARCH ?= $(shell go env GOARCH)
# Container runtime command
CONTAINER_RUN = podman run --rm -v $(PWD):/app $(CONTAINER_IMAGE_NAME)
##############################
# HELP
##############################
.PHONY: help
help: ## Show this help message
@echo "Usage: make [target]"
@echo ""
@echo "Available targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
.DEFAULT_GOAL := help
##############################
# CONTAINER
##############################
.PHONY: container-build-image
container-build-image: ## Build container image
@podman build -f Containerfile -t $(CONTAINER_IMAGE_NAME) .
.PHONY: container-build-force
container-build-force: ## Force rebuild container image (no cache)
@podman build --no-cache -f Containerfile -t $(CONTAINER_IMAGE_NAME) .
.PHONY: container-clean
container-clean: ## Remove container image
@podman rmi $(CONTAINER_IMAGE_NAME) 2>/dev/null || true
##############################
# RELEASE
##############################
.PHONY: release-snapshot
release-snapshot: container-build-image ## Build and release snapshot (testing)
@$(CONTAINER_RUN) goreleaser release --snapshot --clean
.PHONY: build-snapshot
build-snapshot: container-build-image ## Build snapshot without release
@$(CONTAINER_RUN) goreleaser build --snapshot --clean
##############################
# BUILD
##############################
.PHONY: build
build: container-build-image ## Build the application binary
@$(CONTAINER_RUN) env GOOS=$(BUILD_GOOS) GOARCH=$(BUILD_GOARCH) \
go build -o $(APP_NAME) ./cmd/$(APP_NAME)
.PHONY: build-local
build-local: ## Build locally without container (requires Go installed)
@go build -o $(APP_NAME) ./cmd/$(APP_NAME)
.PHONY: run
run: build ## Build and run the application
@./$(APP_NAME)
.PHONY: clean
clean: ## Clean build artifacts
@rm -f $(APP_NAME)
@rm -rf dist/
##############################
# QUALITY
##############################
.PHONY: quality
quality: container-build-image ## Run linter checks
@$(CONTAINER_RUN) golangci-lint run
.PHONY: quality-local
quality-local: ## Run linter locally (requires golangci-lint installed)
@golangci-lint run
.PHONY: test
test: ## Run tests
@go test -v ./...
.PHONY: test-coverage
test-coverage: ## Run tests with coverage
@go test -v -coverprofile=coverage.out ./...
@go tool cover -html=coverage.out -o coverage.html
##############################
# SECURITY
##############################
.PHONY: security
security: security-vuln security-scan ## Run all security checks
.PHONY: security-vuln
security-vuln: container-build-image ## Check for known vulnerabilities
@$(CONTAINER_RUN) govulncheck ./...
.PHONY: security-vuln-local
security-vuln-local: ## Check vulnerabilities locally (requires govulncheck)
@govulncheck ./...
.PHONY: security-scan
security-scan: container-build-image ## Run security scanner
@$(CONTAINER_RUN) gosec ./...
.PHONY: security-scan-local
security-scan-local: ## Run security scanner locally (requires gosec)
@gosec ./...
##############################
# WEBSITE
##############################
.PHONY: build-site
build-site: ## Build the static website
@node build.js
.PHONY: serve-site
serve-site: ## Serve the website locally
@npx http-server docs -p 3000
.PHONY: dev-site
dev-site: build-site serve-site ## Build and serve the website
##############################
# UTILITY
##############################
.PHONY: install
install: build-local ## Install binary to $GOPATH/bin
@go install ./cmd/$(APP_NAME)
.PHONY: deps
deps: ## Download and tidy dependencies
@go mod download
@go mod tidy
.PHONY: deps-update
deps-update: ## Update all dependencies
@go get -u ./...
@go mod tidy