sshm/Makefile
Gu1llaum-3 0975ae2fe2 git commit -m "feat: add GoReleaser for automated releases and Homebrew integration
- Replace manual GitHub Actions workflow
- Add automated Formula updates to homebrew-sshm tap
- Support pre-releases with auto-detection
- Standardize cross-platform binary distribution"
2025-09-17 14:14:49 +02:00

45 lines
1.0 KiB
Makefile

.PHONY: build build-local test clean release snapshot
# Version can be overridden via environment variable or command line
VERSION ?= dev
# Go build flags
LDFLAGS := -s -w -X github.com/Gu1llaum-3/sshm/cmd.AppVersion=$(VERSION)
# Build with specific version
build:
@mkdir -p dist
go build -ldflags="$(LDFLAGS)" -o dist/sshm .
# Build with git version
build-local: VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
build-local: build
# Run tests
test:
go test ./...
# Clean build artifacts
clean:
rm -rf dist
# Release with GoReleaser (requires tag)
release:
@if [ -z "$(shell git tag --points-at HEAD)" ]; then \
echo "Error: No git tag found at current commit. Create a tag first with: git tag vX.Y.Z"; \
exit 1; \
fi
goreleaser release --clean
# Build snapshot (without tag)
snapshot:
goreleaser release --snapshot --clean
# Check GoReleaser config
release-check:
goreleaser check
# Run GoReleaser in dry-run mode
release-dry-run:
goreleaser release --snapshot --skip=publish --clean