Skip to content

Commit

Permalink
Add makefile target releasever
Browse files Browse the repository at this point in the history
See README.md for how to use.
  • Loading branch information
tigrannajaryan committed Jan 17, 2025
1 parent 8d97211 commit b45b7f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ To run tests: `make`

1. To release a new version vX.Y.Z run `make prepver VERSION=vX.Y.Z` to update go.mod
files.
2. TBD.
2. Create a PR with changes and get it merged.
3. Run `make releasever VERSION=vX.Y.Z` to create and push version tags to github.

## Splunk Copyright Notice

Expand Down
20 changes: 19 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Function to execute a command.
# Accepts command to execute as first parameter.
define exec-command
$(1)

endef

.PHONY: default
default:
cd stefgen && make
Expand All @@ -17,11 +24,15 @@ all:
cd otelcol && make all
cd benchmarks && make all

prepver:
.PHONY: verifyver
verifyver:
ifndef VERSION
@echo "VERSION is unset or set to the empty string"
@exit 1
endif

.PHONY: prepver
prepver: verifyver
echo Updating to version ${VERSION}
cd go/grpc && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION} && go mod tidy
cd go/otel && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION} \
Expand All @@ -30,3 +41,10 @@ endif
&& go mod edit -require=github.com/splunk/stef/go/otel@${VERSION} && go mod tidy
cd otelcol && go mod tidy
cd benchmarks && go mod tidy

MODULES := go/pkg go/grpc go/otel go/pdata

.PHONY: releasever
releasever: verifyver
echo Tagging version $(VERSION)
$(foreach gomod,$(MODULES),$(call exec-command,git tag $(gomod)/$(VERSION) && git push origin $(gomod)/$(VERSION)))

0 comments on commit b45b7f4

Please sign in to comment.