Skip to content

Instantly share code, notes, and snippets.

@gebv
Last active July 5, 2023 03:17
Show Gist options
  • Save gebv/3d1a13a765a113b8e874bbf245c068b3 to your computer and use it in GitHub Desktop.
Save gebv/3d1a13a765a113b8e874bbf245c068b3 to your computer and use it in GitHub Desktop.
Useful Makefile tasks (replenishable gist)
CHANGELOG ?= docker run --rm \
-v ${PWD}:/workdir \
-w /workdir \
quay.io/git-chglog/git-chglog
PROTOC ?= docker run --rm -u ${shell id -u} \
-v ${PWD}:/defs namely/protoc-all:1.51_1 \
-l go \
--with-validator \
-o ./ \
-i ./proto
gen-changelog:
# to update the changelog according to the future version
# VERSION=XXX make changelog
# otherwise
# make changelog
# will result in putting everything after the last tag into unreleased
ifeq ($(VERSION),)
$(CHANGELOG) -o CHANGELOG.md
else
$(CHANGELOG) --next-tag $(VERSION) -o CHANGELOG.md
endif
gen-proto:
# protobuf / gRPC
mkdir -p ./api/v1
find ./api/v1 -name '*.pb.*go' -delete
$(PROTOC) \
-d ./proto/v1_foo.proto
$(PROTOC) \
-d ./proto/v1_bar.proto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment