mirror of
https://github.com/git-chglog/git-chglog.git
synced 2026-01-23 02:15:12 +00:00
37 lines
707 B
Makefile
37 lines
707 B
Makefile
VERSION?=$$(git describe --tags --always)
|
|
|
|
LDFLAGS="-X main.version=$(VERSION)"
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf ./dist/
|
|
rm -rf ./git-chglog
|
|
rm -rf $(GOPATH)/bin/git-chglog
|
|
rm -rf cover.out
|
|
|
|
.PHONY: build
|
|
build:
|
|
go build -ldflags=$(LDFLAGS) -o git-chglog ./cmd/git-chglog
|
|
|
|
.PHONY: test
|
|
test:
|
|
go test -covermode atomic -coverprofile cover.out -v ./...
|
|
|
|
.PHONY: install
|
|
install:
|
|
go install ./cmd/git-chglog
|
|
|
|
.PHONY: changelog
|
|
changelog: build
|
|
./git-chglog --next-tag $(VERSION) -o CHANGELOG.md
|
|
|
|
.PHONY: lint
|
|
lint:
|
|
@golangci-lint run
|
|
|
|
.PHONY: release
|
|
release: changelog
|
|
@git add CHANGELOG.md
|
|
@git commit -m "chore: update changelog for $(VERSION)"
|
|
git tag $(VERSION)
|
|
git push origin master $(VERSION)
|