Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add makefile target releasever #18

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)))
Loading