Skip to content

Commit 266dca6

Browse files
committed
chore: add Makefile
Build targets: - build: compile with version from git - test: run full test suite - install: install to GOPATH - clean: remove binary - gh-install: install as gh CLI extension
1 parent 6b6b123 commit 266dca6

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.PHONY: build test install clean
2+
3+
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
4+
LDFLAGS := -ldflags "-X github.com/boneskull/gh-stack/cmd.version=$(VERSION)"
5+
6+
build:
7+
go build $(LDFLAGS) -o gh-stack .
8+
9+
test:
10+
go test ./... -v
11+
12+
install:
13+
go install $(LDFLAGS) .
14+
15+
clean:
16+
rm -f gh-stack
17+
18+
# Install as gh extension
19+
gh-install: build
20+
mkdir -p ~/.local/share/gh/extensions/gh-stack
21+
cp gh-stack ~/.local/share/gh/extensions/gh-stack/

0 commit comments

Comments
 (0)