-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
24 lines (20 loc) · 812 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export GOPATH=$(shell pwd)
test:
go test -v
fmt:
gofmt -s -w *.go
CURVER ?= $(shell git fetch --tags && git tag | tail -1)
NEWVER ?= $(shell echo $(CURVER) | awk -F. '{print $$1"."$$2"."$$3+1}')
TODAY := $(shell date +%Y-%m-%d)
changes:
@git log --pretty=format:"* %s [%cn] [%h]" --no-merges ^$(CURVER) HEAD sorty.go | grep -vE 'gofmt|go fmt'
update-changelog:
@echo "# Changelog" > CHANGELOG.md.new; \
echo >> CHANGELOG.md.new; \
echo "## $(NEWVER) - $(TODAY)" >> CHANGELOG.md.new; \
echo >> CHANGELOG.md.new; \
$(MAKE) changes | \
perl -pe 's{\[([a-f0-9]+)\]}{[[$$1](https://github.com/coryb/sorty/commit/$$1)]}g' | \
perl -pe 's{\#(\d+)}{[#$$1](https://github.com/coryb/sorty/issues/$$1)}g' >> CHANGELOG.md.new; \
tail +2 CHANGELOG.md >> CHANGELOG.md.new; \
mv CHANGELOG.md.new CHANGELOG.md