Skip to content

Commit b2a4951

Browse files
authored
[chore] Align GoReleaser snapshot config (#1228)
* update snapshot version config * update package tests to new package naming scheme
1 parent 4375da7 commit b2a4951

File tree

9 files changed

+24
-6
lines changed

9 files changed

+24
-6
lines changed

.github/workflows/base-package-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
name: linux-packages
3636

3737
- name: Test ${{ matrix.type }} package
38-
run: ./scripts/package-tests/package-tests.sh ./otelcol*-SNAPSHOT-*_linux_amd64.${{ matrix.type }} ${{ inputs.distribution }}
38+
run: ./scripts/package-tests/package-tests.sh ./otelcol*-next_linux_amd64.${{ matrix.type }} ${{ inputs.distribution }}
3939

4040
create-issue:
4141
name: Create GitHub Issue

cmd/builder/.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ archives:
5252
- formats:
5353
- binary
5454
snapshot:
55-
version_template: '{{ .Tag }}-next'
55+
version_template: '{{ incpatch .Version }}-next'
5656
checksum:
5757
name_template: checksums.txt
5858
dockers:

cmd/goreleaser/internal/configure.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ var (
157157
WithDefaultPartial().
158158
WithDefaultRelease().
159159
WithNightlyConfig().
160+
WithDefaultSnapshot().
160161
Build()
161162

162163
// ebpf-profiler distro
@@ -183,6 +184,7 @@ var (
183184
WithDefaultPartial().
184185
WithDefaultRelease().
185186
WithNightlyConfig().
187+
WithDefaultSnapshot().
186188
Build()
187189

188190
// OCB binary
@@ -456,6 +458,13 @@ func (b *distributionBuilder) WithDefaultBinaryChecksum() *distributionBuilder {
456458
return b
457459
}
458460

461+
func (b *distributionBuilder) WithDefaultSnapshot() *distributionBuilder {
462+
b.dist.snapshot = config.Snapshot{
463+
VersionTemplate: "{{ incpatch .Version }}-next",
464+
}
465+
return b
466+
}
467+
459468
func (b *distributionBuilder) WithDefaultMonorepo() *distributionBuilder {
460469
b.configFuncs = append(b.configFuncs, func(d *distribution) {
461470
b.dist.monorepo = config.Monorepo{
@@ -544,6 +553,7 @@ func (b *distributionBuilder) binaryRelease(header string) config.Release {
544553

545554
func (b *distributionBuilder) WithPackagingDefaults() *distributionBuilder {
546555
return b.WithDefaultArchives().
556+
WithDefaultSnapshot().
547557
WithDefaultChecksum().
548558
WithDefaultMonorepo().
549559
WithDefaultEnv().
@@ -561,11 +571,9 @@ func (b *distributionBuilder) WithBinaryPackagingDefaults() *distributionBuilder
561571
b.dist.changelog = config.Changelog{
562572
Disable: "true",
563573
}
564-
b.dist.snapshot = config.Snapshot{
565-
VersionTemplate: "{{ .Tag }}-next",
566-
}
567574

568575
return b.WithBinArchive().
576+
WithDefaultSnapshot().
569577
WithDefaultChecksum().
570578
WithDefaultEnv().
571579
WithDefaultSigns().

cmd/opampsupervisor/.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ nfpms:
7979
description: OpenTelemetry Collector - opampsupervisor
8080
license: Apache 2.0
8181
snapshot:
82-
version_template: '{{ .Tag }}-next'
82+
version_template: '{{ incpatch .Version }}-next'
8383
checksum:
8484
name_template: checksums.txt
8585
dockers:

distributions/otelcol-contrib/.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ nfpms:
103103
maintainer: The OpenTelemetry Collector maintainers <[email protected]>
104104
description: OpenTelemetry Collector - otelcol-contrib
105105
license: Apache 2.0
106+
snapshot:
107+
version_template: '{{ incpatch .Version }}-next'
106108
checksum:
107109
name_template: '{{ .ProjectName }}_otelcol-contrib{{ if eq .Runtime.Goos "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
108110
dockers:

distributions/otelcol-ebpf-profiler/.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ archives:
2929
ids:
3030
- otelcol-ebpf-profiler-linux
3131
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
32+
snapshot:
33+
version_template: '{{ incpatch .Version }}-next'
3234
checksum:
3335
name_template: '{{ .ProjectName }}_otelcol-ebpf-profiler{{ if eq .Runtime.Goos "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
3436
dockers:

distributions/otelcol-k8s/.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ archives:
4444
- otelcol-k8s-linux
4545
- otelcol-k8s-windows
4646
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
47+
snapshot:
48+
version_template: '{{ incpatch .Version }}-next'
4749
checksum:
4850
name_template: '{{ .ProjectName }}_otelcol-k8s{{ if eq .Runtime.Goos "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
4951
dockers:

distributions/otelcol-otlp/.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ nfpms:
9494
maintainer: The OpenTelemetry Collector maintainers <[email protected]>
9595
description: OpenTelemetry Collector - otelcol-otlp
9696
license: Apache 2.0
97+
snapshot:
98+
version_template: '{{ incpatch .Version }}-next'
9799
checksum:
98100
name_template: '{{ .ProjectName }}_otelcol-otlp{{ if eq .Runtime.Goos "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
99101
dockers:

distributions/otelcol/.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ nfpms:
9898
maintainer: The OpenTelemetry Collector maintainers <[email protected]>
9999
description: OpenTelemetry Collector - otelcol
100100
license: Apache 2.0
101+
snapshot:
102+
version_template: '{{ incpatch .Version }}-next'
101103
checksum:
102104
name_template: '{{ .ProjectName }}_otelcol{{ if eq .Runtime.Goos "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
103105
dockers:

0 commit comments

Comments
 (0)