Skip to content

Commit 2d5727b

Browse files
authored
Fix checksum files being overwritten by windows release (#1086)
* fix checksum files being overwritten by windows release * add changelog entry * adjust changelog entry * adjust changelog entry * adjust changelog entry
1 parent f490720 commit 2d5727b

File tree

7 files changed

+37
-6
lines changed

7 files changed

+37
-6
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: releases
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Fix artifact checksum files being incomplete and split between Linux/Darwin and Windows.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [1002, 1086]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
This fixes a bug that occurred because releases for Windows and other Platforms are split.
20+
The Windows release always overwrote the checksum files already created for Linux and Darwin and so, only
21+
the Windows checksums were accessible in the end.
22+
23+
This change is breaking because checksum files for Linux/Darwin and Windows are now split.
24+
25+
# Optional: The change log or logs in which this entry should be included.
26+
# e.g. '[user]' or '[user, api]'
27+
# Include 'user' if the change is relevant to end users.
28+
# Include 'api' if there is a change to a library API.
29+
# Default: '[user]'
30+
change_logs: []
31+

cmd/goreleaser/internal/configure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func (b *distributionBuilder) sboms() []config.SBOM {
354354
func (b *distributionBuilder) WithDefaultChecksum() *distributionBuilder {
355355
b.configFuncs = append(b.configFuncs, func(d *distribution) {
356356
b.dist.checksum = config.Checksum{
357-
NameTemplate: fmt.Sprintf("{{ .ProjectName }}_%v_checksums.txt", d.name),
357+
NameTemplate: fmt.Sprintf("{{ .ProjectName }}_%v{{ if .Runtime.Goos == \"windows\" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt", d.name),
358358
}
359359
})
360360
return b

distributions/otelcol-contrib/.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ nfpms:
103103
builds:
104104
- otelcol-contrib-linux
105105
checksum:
106-
name_template: '{{ .ProjectName }}_otelcol-contrib_checksums.txt'
106+
name_template: '{{ .ProjectName }}_otelcol-contrib{{ if .Runtime.Goos == "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
107107
dockers:
108108
- goos: linux
109109
goarch: "386"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ archives:
2626
builds:
2727
- otelcol-ebpf-profiler-linux
2828
checksum:
29-
name_template: '{{ .ProjectName }}_otelcol-ebpf-profiler_checksums.txt'
29+
name_template: '{{ .ProjectName }}_otelcol-ebpf-profiler{{ if .Runtime.Goos == "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
3030
dockers:
3131
- goos: linux
3232
goarch: amd64

distributions/otelcol-k8s/.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ archives:
4444
- otelcol-k8s-linux
4545
- otelcol-k8s-windows
4646
checksum:
47-
name_template: '{{ .ProjectName }}_otelcol-k8s_checksums.txt'
47+
name_template: '{{ .ProjectName }}_otelcol-k8s{{ if .Runtime.Goos == "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
4848
dockers:
4949
- goos: linux
5050
goarch: amd64

distributions/otelcol-otlp/.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ nfpms:
9494
builds:
9595
- otelcol-otlp-linux
9696
checksum:
97-
name_template: '{{ .ProjectName }}_otelcol-otlp_checksums.txt'
97+
name_template: '{{ .ProjectName }}_otelcol-otlp{{ if .Runtime.Goos == "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
9898
dockers:
9999
- goos: linux
100100
goarch: "386"

distributions/otelcol/.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ nfpms:
9898
builds:
9999
- otelcol-linux
100100
checksum:
101-
name_template: '{{ .ProjectName }}_otelcol_checksums.txt'
101+
name_template: '{{ .ProjectName }}_otelcol{{ if .Runtime.Goos == "windows" }}_{{ .Runtime.Goos }}{{ end }}_checksums.txt'
102102
dockers:
103103
- goos: linux
104104
goarch: "386"

0 commit comments

Comments
 (0)