Skip to content

Commit 4b8bc4c

Browse files
committed
feat: add makefile for building git-semver
**Description**: Add makefile for building `git-semver`. **Related Issue(s)**: Implements #23 Signed-off-by: Andrew Brandt <[email protected]>
1 parent afbe261 commit 4b8bc4c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ git-semver
33
.testworkdir
44

55
dist/
6+
7+
/bin

makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Makefile at repo root
2+
3+
BINARY_NAME ?= git-semver
4+
BUILD_DIR := cli
5+
BIN_DIR := bin
6+
7+
.PHONY: all build clean test
8+
9+
all: build
10+
11+
## Build the CLI into ./bin/
12+
build:
13+
@echo "Building $(BINARY_NAME) from $(BUILD_DIR)..."
14+
@mkdir -p $(BIN_DIR)
15+
@cd $(BUILD_DIR) && go build -o ../$(BIN_DIR)/$(BINARY_NAME)
16+
17+
## Run all Go tests
18+
test:
19+
@echo "Running tests..."
20+
@go test ./...
21+
22+
## Remove build artifacts
23+
clean:
24+
@echo "Cleaning build artifacts..."
25+
@rm -rf $(BIN_DIR)/

0 commit comments

Comments
 (0)