File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ SHELL := bash
33
44GIMME_GENERATE := ./gimme-generate
55
6+ TAG_VERSION ?= notset
7+
68.PHONY : all
79all : lint assert-copyright generate
810
1921generate : .testdata/sample-versions.txt
2022 @true
2123
24+ .PHONY : tag
25+ tag : .assert-tag-version-defined .assert-tag-matches-source
26+ git tag -s -a -m ' Release $(TAG_VERSION)' ' $(TAG_VERSION)' $(TAG_REF )
27+
28+ .PHONY : .assert-tag-version-defined
29+ .assert-tag-version-defined :
30+ ifeq ($(TAG_VERSION ) , notset)
31+ $(error TAG_VERSION must be set)
32+ endif
33+
34+ .PHONY : .assert-tag-matches-source
35+ .assert-tag-matches-source :
36+ @diff -u \
37+ --label a/version/gimme \
38+ <( awk ' BEGIN { FS="="; } /^readonly GIMME_VERSION/ { gsub(/"/, "", $$2); print $$2 }' gimme) \
39+ --label b/version/TAG_VERSION \
40+ <( echo ' $(TAG_VERSION)' )
41+
2242$(GIMME_GENERATE ) : $(shell git ls-files '* .go') internal/sample-stub-header
2343 go build -o $@ ./internal/cmd/gimme-generate/
2444
You can’t perform that action at this time.
0 commit comments