diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5659ca..c367a9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [master, main] + branches: [main] pull_request: - branches: [master, main] + branches: [main] workflow_call: permissions: diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c7202f3 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +.PHONY: build test fmt lint clean all help + +# Default target +all: fmt lint build test + +# Build the binary +build: + @echo "Building git-get..." + go build -o git-get ./cmd/ + +# Run tests with race detection +test: + @echo "Running tests..." + go test -race ./... + +# Format code +fmt: + @echo "Formatting code..." + go fmt ./... + +# Run linter with auto-fix +lint: + @echo "Running linter..." + golangci-lint run --fix + +# Clean built binaries +clean: + @echo "Cleaning..." + rm -f git-get + +# Show help +help: + @echo "Available targets:" + @echo " build - Build the git-get binary" + @echo " test - Run tests with race detection" + @echo " fmt - Format Go code" + @echo " lint - Run golangci-lint with auto-fix" + @echo " clean - Remove built binaries" + @echo " all - Run fmt, lint, build, and test (default)" + @echo " help - Show this help message" \ No newline at end of file diff --git a/README.md b/README.md index 3ca6462..1873482 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![build](https://github.com/grdl/git-get/workflows/build/badge.svg)](https://github.com/grdl/git-get/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/grdl/git-get)](https://goreportcard.com/report/github.com/grdl/git-get) [![Latest Release](https://img.shields.io/github/v/release/grdl/git-get)](https://github.com/grdl/git-get/releases/latest) -[![Go Version](https://img.shields.io/github/go-mod/go-version/grdl/git-get)](https://github.com/grdl/git-get/blob/master/go.mod) +[![Go Version](https://img.shields.io/github/go-mod/go-version/grdl/git-get)](https://github.com/grdl/git-get/blob/main/go.mod) [![License](https://img.shields.io/github/license/grdl/git-get)](LICENSE.md) A tool to clone, organize, and manage multiple Git repositories with an automatic directory structure based on repository URLs.