From b4cfdb9e8abb45bd8e73f05eb6e8ffd457ae8b0d Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Sat, 27 Apr 2024 08:46:26 +0400 Subject: [PATCH 1/4] GoReleaser: publish Homebrew formula to a Tap on each new release --- distributions/otelcol-contrib/.goreleaser.yaml | 10 ++++++++++ distributions/otelcol/.goreleaser.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index 515d8ba6..daca1b72 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -249,3 +249,13 @@ sboms: artifacts: archive - id: package artifacts: package +brews: + - name: otelcol-contrib + description: "OpenTelemtry collector distribution containing only core components" + homepage: "https://opentelemetry.io/docs/collector/" + license: "Apache-2.0" + ids: + - otelcol-contrib + repository: + owner: open-telemetry + name: homebrew-tap diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index d1e19e3e..27675064 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -249,3 +249,13 @@ sboms: artifacts: archive - id: package artifacts: package +brews: + - name: otelcol + description: "OpenTelemtry collector distribution containing both core and contrib components" + homepage: "https://opentelemetry.io/docs/collector/" + license: "Apache-2.0" + ids: + - otelcol + repository: + owner: open-telemetry + name: homebrew-tap From 3f6c878b7a15c04d87a135c6d9d198e734300319 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Sun, 28 Apr 2024 08:37:20 +0400 Subject: [PATCH 2/4] =?UTF-8?q?Fix=20typo:=20OpenTelemtry=20=E2=86=92=20Op?= =?UTF-8?q?enTelemetry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antoine Toulme --- distributions/otelcol-contrib/.goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index daca1b72..3edf77ec 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -251,7 +251,7 @@ sboms: artifacts: package brews: - name: otelcol-contrib - description: "OpenTelemtry collector distribution containing only core components" + description: "OpenTelemetry collector distribution containing only core components" homepage: "https://opentelemetry.io/docs/collector/" license: "Apache-2.0" ids: From eb9f98bd7ed9d5861f4f93d9a01c319248ef4a3d Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Sun, 28 Apr 2024 08:37:25 +0400 Subject: [PATCH 3/4] =?UTF-8?q?Fix=20typo:=20OpenTelemtry=20=E2=86=92=20Op?= =?UTF-8?q?enTelemetry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antoine Toulme --- distributions/otelcol/.goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index 27675064..441ed79d 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -251,7 +251,7 @@ sboms: artifacts: package brews: - name: otelcol - description: "OpenTelemtry collector distribution containing both core and contrib components" + description: "OpenTelemetry collector distribution containing both core and contrib components" homepage: "https://opentelemetry.io/docs/collector/" license: "Apache-2.0" ids: From 3b48905ac45f3dd046560f1201e6d96a1c343e7d Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Sun, 28 Apr 2024 21:27:43 +0400 Subject: [PATCH 4/4] Move "brews:"-related GoReleaser config generation into Golang codebase --- cmd/goreleaser/internal/configure.go | 26 +++++++++++++++++++ .../otelcol-contrib/.goreleaser.yaml | 20 +++++++------- distributions/otelcol/.goreleaser.yaml | 20 +++++++------- 3 files changed, 46 insertions(+), 20 deletions(-) diff --git a/cmd/goreleaser/internal/configure.go b/cmd/goreleaser/internal/configure.go index 00cd2980..37e635a4 100644 --- a/cmd/goreleaser/internal/configure.go +++ b/cmd/goreleaser/internal/configure.go @@ -51,6 +51,21 @@ func Generate(dist string) config.Project { Signs: Sign(), DockerSigns: DockerSigns(), SBOMs: SBOM(), + Brews: []config.Homebrew{ + { + Name: dist, + Description: Description(dist), + Homepage: "https://opentelemetry.io/docs/collector/", + License: "Apache-2.0", + IDs: []string{ + dist, + }, + Repository: config.RepoRef{ + Owner: "open-telemetry", + Name: "homebrew-tap", + }, + }, + }, } } @@ -297,3 +312,14 @@ func SBOM() []config.SBOM { }, } } + +func Description(dist string) string { + switch dist { + case "otelcol": + return "OpenTelemetry collector distribution containing only core components" + case "otelcol-contrib": + return "OpenTelemetry collector distribution containing both core and contrib components" + default: + return "" + } +} diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index 3edf77ec..87ef0e22 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -3,6 +3,16 @@ partial: project_name: opentelemetry-collector-releases env: - COSIGN_YES=true +brews: + - name: otelcol-contrib + repository: + owner: open-telemetry + name: homebrew-tap + description: OpenTelemetry collector distribution containing both core and contrib components + homepage: https://opentelemetry.io/docs/collector/ + license: Apache-2.0 + ids: + - otelcol-contrib builds: - id: otelcol-contrib goos: @@ -249,13 +259,3 @@ sboms: artifacts: archive - id: package artifacts: package -brews: - - name: otelcol-contrib - description: "OpenTelemetry collector distribution containing only core components" - homepage: "https://opentelemetry.io/docs/collector/" - license: "Apache-2.0" - ids: - - otelcol-contrib - repository: - owner: open-telemetry - name: homebrew-tap diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index 441ed79d..abf17066 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -3,6 +3,16 @@ partial: project_name: opentelemetry-collector-releases env: - COSIGN_YES=true +brews: + - name: otelcol + repository: + owner: open-telemetry + name: homebrew-tap + description: OpenTelemetry collector distribution containing only core components + homepage: https://opentelemetry.io/docs/collector/ + license: Apache-2.0 + ids: + - otelcol builds: - id: otelcol goos: @@ -249,13 +259,3 @@ sboms: artifacts: archive - id: package artifacts: package -brews: - - name: otelcol - description: "OpenTelemetry collector distribution containing both core and contrib components" - homepage: "https://opentelemetry.io/docs/collector/" - license: "Apache-2.0" - ids: - - otelcol - repository: - owner: open-telemetry - name: homebrew-tap