From bb451df29a07409243b4fbc4e66774ed62732354 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Mon, 25 Nov 2024 11:15:36 +0100 Subject: [PATCH] [chore] move partial goreleaser config to native code Signed-off-by: Moritz Wiesinger --- cmd/goreleaser/internal/configure.go | 3 +++ cmd/goreleaser/main.go | 11 ----------- distributions/otelcol-contrib/.goreleaser-build.yaml | 4 ++-- distributions/otelcol-contrib/.goreleaser.yaml | 4 ++-- distributions/otelcol-k8s/.goreleaser.yaml | 4 ++-- distributions/otelcol-otlp/.goreleaser.yaml | 4 ++-- distributions/otelcol/.goreleaser.yaml | 4 ++-- 7 files changed, 13 insertions(+), 21 deletions(-) diff --git a/cmd/goreleaser/internal/configure.go b/cmd/goreleaser/internal/configure.go index a83fd71a..0ff8e37c 100644 --- a/cmd/goreleaser/internal/configure.go +++ b/cmd/goreleaser/internal/configure.go @@ -47,6 +47,7 @@ var ( K8sDockerSkipArchs = map[string]bool{"arm": true, "386": true} K8sGoos = []string{"linux"} K8sArchs = []string{"amd64", "arm64", "ppc64le", "s390x"} + Partial = config.Partial{By: "target"} ) func GenerateContribBuildOnly(dist string, buildOrRest bool) config.Project { @@ -57,6 +58,7 @@ func GenerateContribBuildOnly(dist string, buildOrRest bool) config.Project { Monorepo: config.Monorepo{ TagPrefix: "v", }, + Partial: Partial, } } @@ -80,6 +82,7 @@ func Generate(dist string, buildOrRest bool) config.Project { Monorepo: config.Monorepo{ TagPrefix: "v", }, + Partial: Partial, } } diff --git a/cmd/goreleaser/main.go b/cmd/goreleaser/main.go index 9695192b..0e6fda60 100644 --- a/cmd/goreleaser/main.go +++ b/cmd/goreleaser/main.go @@ -43,19 +43,8 @@ func main() { project = internal.Generate(*distFlag, *contribBuildOrRestFlag) } - partial := map[string]any{ - "partial": map[string]any{ - "by": "target", - }, - } e := yaml.NewEncoder(os.Stdout) e.SetIndent(2) - if err := e.Encode(partial); err != nil { - log.Fatal(err) - } - - e = yaml.NewEncoder(os.Stdout) - e.SetIndent(2) if err := e.Encode(&project); err != nil { log.Fatal(err) } diff --git a/distributions/otelcol-contrib/.goreleaser-build.yaml b/distributions/otelcol-contrib/.goreleaser-build.yaml index b5f60c0d..36d82931 100644 --- a/distributions/otelcol-contrib/.goreleaser-build.yaml +++ b/distributions/otelcol-contrib/.goreleaser-build.yaml @@ -1,5 +1,3 @@ -partial: - by: target version: 2 project_name: opentelemetry-collector-releases builds: @@ -41,3 +39,5 @@ builds: - CGO_ENABLED=0 monorepo: tag_prefix: v +partial: + by: target diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index 653e0dd6..4ccf15c1 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -1,5 +1,3 @@ -partial: - by: target version: 2 project_name: opentelemetry-collector-releases env: @@ -258,3 +256,5 @@ sboms: artifacts: package monorepo: tag_prefix: v +partial: + by: target diff --git a/distributions/otelcol-k8s/.goreleaser.yaml b/distributions/otelcol-k8s/.goreleaser.yaml index 9ff03c57..bd0457bf 100644 --- a/distributions/otelcol-k8s/.goreleaser.yaml +++ b/distributions/otelcol-k8s/.goreleaser.yaml @@ -1,5 +1,3 @@ -partial: - by: target version: 2 project_name: opentelemetry-collector-releases env: @@ -151,3 +149,5 @@ sboms: artifacts: package monorepo: tag_prefix: v +partial: + by: target diff --git a/distributions/otelcol-otlp/.goreleaser.yaml b/distributions/otelcol-otlp/.goreleaser.yaml index a1e9681c..e4d91850 100644 --- a/distributions/otelcol-otlp/.goreleaser.yaml +++ b/distributions/otelcol-otlp/.goreleaser.yaml @@ -1,5 +1,3 @@ -partial: - by: target version: 2 project_name: opentelemetry-collector-releases env: @@ -246,3 +244,5 @@ sboms: artifacts: package monorepo: tag_prefix: v +partial: + by: target diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index ec3b4132..8a73d0df 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -1,5 +1,3 @@ -partial: - by: target version: 2 project_name: opentelemetry-collector-releases env: @@ -262,3 +260,5 @@ sboms: artifacts: package monorepo: tag_prefix: v +partial: + by: target