Skip to content

Commit

Permalink
Add gorelease Make target (#4169)
Browse files Browse the repository at this point in the history
* Add gorelease Make target

* Update RELEASING.md

* Update RELEASING.md

* Fix merge

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
  • Loading branch information
3 people authored Aug 21, 2023
1 parent 7d9626d commit 9ac039a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ $(CROSSLINK): PACKAGE=go.opentelemetry.io/build-tools/crosslink
GOTMPL = $(TOOLS)/gotmpl
$(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl

tools: $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(MULTIMOD) $(DBOTCONF) $(CROSSLINK) $(GOTMPL)
GORELEASE = $(TOOLS)/gorelease
$(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease

tools: $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(MULTIMOD) $(DBOTCONF) $(CROSSLINK) $(GOTMPL) $(GORELEASE)

# Generate

Expand Down Expand Up @@ -289,13 +292,21 @@ test-gomemcache:

# Releasing

.PHONY: gorelease
gorelease: $(OTEL_GO_MOD_DIRS:%=gorelease/%)
gorelease/%: DIR=$*
gorelease/%:| $(GORELEASE)
@echo "gorelease in $(DIR):" \
&& cd $(DIR) \
&& $(GORELEASE) \
|| echo ""

COREPATH ?= "../opentelemetry-go"
.PHONY: sync-core
sync-core: | $(MULTIMOD)
@[ ! -d $COREPATH ] || ( echo ">> Path to core repository must be set in COREPATH and must exist"; exit 1 )
$(MULTIMOD) verify && $(MULTIMOD) sync -a -o ${COREPATH}


.PHONY: prerelease
prerelease: | $(MULTIMOD)
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
Expand Down
7 changes: 7 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ versions will be. If you are making a release to upgrade the upstream
go.opentelemetry.io/otel packages, all module sets will likely need to be
released.

### Breaking changes validation

You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease)
to ensure that there are no unwanted changes done in the public API.

You can check/report problems with `gorelease` [here](https://golang.org/issues/26420).

### Create a release branch

Update the versions of the module sets you have identified in `versions.yaml`.
Expand Down
2 changes: 1 addition & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
go.opentelemetry.io/build-tools/dbotconf v0.11.0
go.opentelemetry.io/build-tools/gotmpl v0.11.0
go.opentelemetry.io/build-tools/multimod v0.11.0
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
golang.org/x/tools v0.12.0
)

Expand Down Expand Up @@ -193,7 +194,6 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
Expand Down
1 change: 1 addition & 0 deletions tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ import (
_ "go.opentelemetry.io/build-tools/dbotconf"
_ "go.opentelemetry.io/build-tools/gotmpl"
_ "go.opentelemetry.io/build-tools/multimod"
_ "golang.org/x/exp/cmd/gorelease"
_ "golang.org/x/tools/cmd/stringer"
)

0 comments on commit 9ac039a

Please sign in to comment.