-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add build-macos job to workflows and recover Makefile
- Loading branch information
tingzhen.lin
committed
Sep 26, 2022
1 parent
daae05e
commit 3983532
Showing
2 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
COMMIT_REVISION := $(shell git log --pretty=%h -1) | ||
REVISION_FLAG := "-X github.com/lintingzhen/commitizen-go/cmd.revision=${COMMIT_REVISION}" | ||
TARGET := commitizen-go | ||
GOFILES := $(wildcard *.go) $(wildcard cmd/*.go) $(wildcard git/*.go) $(wildcard commit/*.go) | ||
|
||
ifeq ($(OS),Windows_NT) | ||
GOOS := windows | ||
COPY := copy | ||
else | ||
COPY := cp | ||
UNAME_S := $(shell uname -s) | ||
ifeq ($(UNAME_S),Linux) | ||
GOOS := linux | ||
else ifeq ($(UNAME_S),Darwin) | ||
GOOS := darwin | ||
endif | ||
endif | ||
|
||
GIT_EXEC_PATH := $(shell git --exec-path) | ||
|
||
all: ${TARGET} | ||
install: | ||
$(COPY) commitizen-go $(GIT_EXEC_PATH)/git-cz | ||
clean: | ||
rm -rf ${TARGET} | ||
|
||
|
||
commitizen-go: $(GOFILES) | ||
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=amd64 go build -o $@ -ldflags ${REVISION_FLAG} | ||
|
||
.PHONY: all install clean |