1 Star 0 Fork 0

xuziyao/air

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
Rick Yu 提交于 2024-02-21 11:46 . fix: broken golangci-lint tag
AIRVER := $(shell git describe --tags)
LDFLAGS += -X "main.BuildTimestamp=$(shell date -u "+%Y-%m-%d %H:%M:%S")"
LDFLAGS += -X "main.airVersion=$(AIRVER)"
LDFLAGS += -X "main.goVersion=$(shell go version | sed -r 's/go version go(.*)\ .*/\1/')"
GO := GO111MODULE=on CGO_ENABLED=0 go
GOLANGCI_LINT_VERSION = v1.56.2
.PHONY: init
init: install-golangci-lint
go install golang.org/x/tools/cmd/goimports@latest
@echo "Install pre-commit hook"
@ln -s $(shell pwd)/hooks/pre-commit $(shell pwd)/.git/hooks/pre-commit || true
@chmod +x ./hack/check.sh
.PHONY: install-golangci-lint
install-golangci-lint:
ifeq (, $(shell which golangci-lintx))
@$(shell curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin $(GOLANGCI_LINT_VERSION))
endif
.PHONY: setup
setup: init
git init
.PHONY: check
check:
@./hack/check.sh ${scope}
.PHONY: ci
ci: init
@$(GO) mod tidy && $(GO) mod vendor
.PHONY: build
build: check
$(GO) build -ldflags '$(LDFLAGS)'
.PHONY: install
install: check
@echo "Installing air..."
@$(GO) install -ldflags '$(LDFLAGS)'
.PHONY: release
release: check
GOOS=darwin GOARCH=amd64 $(GO) build -ldflags '$(LDFLAGS)' -o bin/darwin/air
GOOS=linux GOARCH=amd64 $(GO) build -ldflags '$(LDFLAGS)' -o bin/linux/air
GOOS=windows GOARCH=amd64 $(GO) build -ldflags '$(LDFLAGS)' -o bin/windows/air.exe
.PHONY: docker-image
docker-image:
docker build -t cosmtrek/air:$(AIRVER) -f ./Dockerfile .
.PHONY: push-docker-image
push-docker-image:
docker push cosmtrek/air:$(AIRVER)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xzy_15043564293/air.git
git@gitee.com:xzy_15043564293/air.git
xzy_15043564293
air
air
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385