Skip to content

Commit

Permalink
Merge branch 'main' into v1.7.1-prep
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat authored Nov 6, 2022
2 parents f243e9b + 9ae955a commit cfb04ee
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ SHELL := bash

GIMME_GENERATE := ./gimme-generate

TAG_VERSION ?= notset

.PHONY: all
all: lint assert-copyright generate

Expand All @@ -19,6 +21,24 @@ lint:
generate: .testdata/sample-versions.txt
@true

.PHONY: tag
tag: .assert-tag-version-defined .assert-tag-matches-source
git tag -s -a -m 'Release $(TAG_VERSION)' '$(TAG_VERSION)' $(TAG_REF)

.PHONY: .assert-tag-version-defined
.assert-tag-version-defined:
ifeq ($(TAG_VERSION), notset)
$(error TAG_VERSION must be set)
endif

.PHONY: .assert-tag-matches-source
.assert-tag-matches-source:
@diff -u \
--label a/version/gimme \
<(awk 'BEGIN { FS="="; } /^readonly GIMME_VERSION/ { gsub(/"/, "", $$2); print $$2 }' gimme) \
--label b/version/TAG_VERSION \
<(echo '$(TAG_VERSION)')

$(GIMME_GENERATE): $(shell git ls-files '*.go') internal/sample-stub-header
go build -o $@ ./internal/cmd/gimme-generate/

Expand Down

0 comments on commit cfb04ee

Please sign in to comment.