Skip to content

Commit

Permalink
[chore] move partial goreleaser config to native code
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies committed Nov 25, 2024
1 parent 9dda072 commit bb451df
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
3 changes: 3 additions & 0 deletions cmd/goreleaser/internal/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -57,6 +58,7 @@ func GenerateContribBuildOnly(dist string, buildOrRest bool) config.Project {
Monorepo: config.Monorepo{
TagPrefix: "v",
},
Partial: Partial,
}
}

Expand All @@ -80,6 +82,7 @@ func Generate(dist string, buildOrRest bool) config.Project {
Monorepo: config.Monorepo{
TagPrefix: "v",
},
Partial: Partial,
}
}

Expand Down
11 changes: 0 additions & 11 deletions cmd/goreleaser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions distributions/otelcol-contrib/.goreleaser-build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
partial:
by: target
version: 2
project_name: opentelemetry-collector-releases
builds:
Expand Down Expand Up @@ -41,3 +39,5 @@ builds:
- CGO_ENABLED=0
monorepo:
tag_prefix: v
partial:
by: target
4 changes: 2 additions & 2 deletions distributions/otelcol-contrib/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
partial:
by: target
version: 2
project_name: opentelemetry-collector-releases
env:
Expand Down Expand Up @@ -258,3 +256,5 @@ sboms:
artifacts: package
monorepo:
tag_prefix: v
partial:
by: target
4 changes: 2 additions & 2 deletions distributions/otelcol-k8s/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
partial:
by: target
version: 2
project_name: opentelemetry-collector-releases
env:
Expand Down Expand Up @@ -151,3 +149,5 @@ sboms:
artifacts: package
monorepo:
tag_prefix: v
partial:
by: target
4 changes: 2 additions & 2 deletions distributions/otelcol-otlp/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
partial:
by: target
version: 2
project_name: opentelemetry-collector-releases
env:
Expand Down Expand Up @@ -246,3 +244,5 @@ sboms:
artifacts: package
monorepo:
tag_prefix: v
partial:
by: target
4 changes: 2 additions & 2 deletions distributions/otelcol/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
partial:
by: target
version: 2
project_name: opentelemetry-collector-releases
env:
Expand Down Expand Up @@ -262,3 +260,5 @@ sboms:
artifacts: package
monorepo:
tag_prefix: v
partial:
by: target

0 comments on commit bb451df

Please sign in to comment.