Skip to content

Commit 6cff3dc

Browse files
committed
update goreleaser version, adapt release config for binary releases
1 parent af7592d commit 6cff3dc

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

cmd/goreleaser/internal/configure.go

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const (
4242
ocbBinary = "builder"
4343
opampBinary = "opampsupervisor"
4444
containerEphemeralTag = "CONTAINER_IMAGE_EPHEMERAL_TAG=latest"
45+
projectName = "opentelemetry-collector-releases"
4546
)
4647

4748
var (
@@ -135,6 +136,7 @@ var (
135136
WithDefaultMonorepo().
136137
WithDefaultEnv().
137138
WithDefaultPartial().
139+
WithDefaultRelease().
138140
Build()
139141

140142
// k8s distro
@@ -159,6 +161,7 @@ var (
159161
WithDefaultMonorepo().
160162
WithDefaultEnv().
161163
WithDefaultPartial().
164+
WithDefaultRelease().
162165
Build()
163166

164167
// ebpf-profiler distro
@@ -183,6 +186,7 @@ var (
183186
WithDefaultMonorepo().
184187
WithDefaultEnv().
185188
WithDefaultPartial().
189+
WithDefaultRelease().
186190
Build()
187191

188192
// OCB binary
@@ -452,6 +456,34 @@ func (b *distributionBuilder) WithDefaultPartial() *distributionBuilder {
452456
return b
453457
}
454458

459+
func (b *distributionBuilder) WithDefaultRelease() *distributionBuilder {
460+
b.configFuncs = append(b.configFuncs, func(d *distribution) {
461+
b.dist.release = config.Release{
462+
ReplaceExistingArtifacts: true,
463+
}
464+
})
465+
return b
466+
}
467+
468+
func (b *distributionBuilder) WithDefaultBinaryRelease() *distributionBuilder {
469+
b.configFuncs = append(b.configFuncs, func(d *distribution) {
470+
b.dist.release = config.Release{
471+
MakeLatest: "false",
472+
GitHub: config.Repo{
473+
Owner: "open-telemetry",
474+
Name: projectName,
475+
},
476+
Header: config.IncludedMarkdown{
477+
FromURL: config.IncludeFromURL{
478+
URL: "something",
479+
},
480+
Content: "### Images and binaries for collector distributions here: https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/{{ .Tag }}",
481+
},
482+
}
483+
})
484+
return b
485+
}
486+
455487
func (b *distributionBuilder) WithPackagingDefaults() *distributionBuilder {
456488
return b.WithDefaultArchives().
457489
WithDefaultChecksum().
@@ -462,7 +494,8 @@ func (b *distributionBuilder) WithPackagingDefaults() *distributionBuilder {
462494
WithDefaultSigns().
463495
WithDefaultDockerSigns().
464496
WithDefaultSBOMs().
465-
WithDefaultPartial()
497+
WithDefaultPartial().
498+
WithDefaultRelease()
466499
}
467500

468501
func (b *distributionBuilder) WithBinaryPackagingDefaults() *distributionBuilder {
@@ -472,7 +505,8 @@ func (b *distributionBuilder) WithBinaryPackagingDefaults() *distributionBuilder
472505
WithDefaultBinaryEnv().
473506
WithDefaultSigns().
474507
WithDefaultDockerSigns().
475-
WithDefaultSBOMs()
508+
WithDefaultSBOMs().
509+
WithDefaultBinaryRelease()
476510
}
477511

478512
func (b *distributionBuilder) WithConfigFunc(configFunc func(*distribution)) *distributionBuilder {
@@ -526,6 +560,7 @@ type distribution struct {
526560
checksum config.Checksum
527561
partial config.Partial
528562
monorepo config.Monorepo
563+
release config.Release
529564
env []string
530565
enableCgo bool
531566
ldFlags string
@@ -539,10 +574,8 @@ func (d *distribution) BuildProject() config.Project {
539574
}
540575

541576
return config.Project{
542-
ProjectName: "opentelemetry-collector-releases",
543-
Release: config.Release{
544-
ReplaceExistingArtifacts: true,
545-
},
577+
ProjectName: projectName,
578+
Release: d.release,
546579
Checksum: d.checksum,
547580
Env: d.env,
548581
Builds: builds,

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-releases
33
go 1.23
44

55
require (
6-
github.com/goreleaser/goreleaser-pro/v2 v2.7.0
6+
github.com/goreleaser/goreleaser-pro/v2 v2.11.0
77
gopkg.in/yaml.v3 v3.0.1
88
)
99

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
2-
github.com/goreleaser/goreleaser-pro/v2 v2.7.0 h1:07p7y2N3chwz1MIs5HwnkTE/OUo63asEQeuPyVP6eag=
3-
github.com/goreleaser/goreleaser-pro/v2 v2.7.0/go.mod h1:GA7Uzk7qKA3efeDmgfWwcMTrDJe+V7D6H5RMqXlFvuc=
2+
github.com/goreleaser/goreleaser-pro/v2 v2.11.0 h1:2OahvDpYJHHuFyLsfPDZxXHEEsXtqvTJ/rJUIjYMQOI=
3+
github.com/goreleaser/goreleaser-pro/v2 v2.11.0/go.mod h1:GA7Uzk7qKA3efeDmgfWwcMTrDJe+V7D6H5RMqXlFvuc=
44
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
55
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
66
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=

0 commit comments

Comments
 (0)