Skip to content

Commit 8fd7743

Browse files
committed
feat: create binary without OS and arch in name
Previously binaries were created with their architecture and OS included as part of their binary name. Removing the `binary: scorecard-<linux|darwin|windows>-{{ .Arch }}` line allows us to collapse all of the different build configs into a single universal build that caters for [linux,darwin,windos]*[arm64,amd64] `- -buildmode=exe` was not needed on the windows builds and was also removed. closes ossf#4517 Signed-off-by: Tim Sparg <[email protected]>
1 parent 2d95671 commit 8fd7743

File tree

1 file changed

+1
-52
lines changed

1 file changed

+1
-52
lines changed

.goreleaser.yml

+1-52
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ before:
1010
gomod:
1111
proxy: true
1212
builds:
13-
- id: linux
14-
binary: scorecard-linux-{{ .Arch }}
15-
no_unique_dist_dir: true
13+
- id: universal
1614
flags:
1715
# trimpath is for reproducible builds
1816
# remove all file system paths from the resulting executable.
@@ -29,61 +27,12 @@ builds:
2927
mod_timestamp: '{{ .CommitTimestamp }}'
3028
goos:
3129
- linux
32-
goarch:
33-
- amd64
34-
- arm64
35-
ldflags:
36-
- -s {{.Env.VERSION_LDFLAGS}}
37-
38-
- id: darwin
39-
binary: scorecard-darwin-{{ .Arch }}
40-
no_unique_dist_dir: true
41-
flags:
42-
# trimpath is for reproducible builds
43-
# remove all file system paths from the resulting executable.
44-
# Instead of absolute file system paths, the recorded file names
45-
# will begin with either "go" (for the standard library),
46-
# or a module path@version (when using modules),
47-
# or a plain import path (when using GOPATH).
48-
- -trimpath
49-
- -tags=netgo
50-
# Set the modified timestamp on the output binary, typically
51-
# you would do this to ensure a build was reproducible. Pass
52-
# empty string to skip modifying the output.
53-
# Default is empty string.
54-
mod_timestamp: '{{ .CommitTimestamp }}'
55-
goos:
5630
- darwin
57-
goarch:
58-
- amd64
59-
- arm64
60-
ldflags:
61-
- -s {{.Env.VERSION_LDFLAGS}}
62-
63-
- id: windows
64-
binary: scorecard-windows-{{ .Arch }}
65-
no_unique_dist_dir: true
66-
flags:
67-
# trimpath is for reproducible builds
68-
# remove all file system paths from the resulting executable.
69-
# Instead of absolute file system paths, the recorded file names
70-
# will begin with either "go" (for the standard library),
71-
# or a module path@version (when using modules),
72-
# or a plain import path (when using GOPATH).
73-
- -trimpath
74-
- -tags=netgo
75-
# Set the modified timestamp on the output binary, typically
76-
# you would do this to ensure a build was reproducible. Pass
77-
# empty string to skip modifying the output.
78-
# Default is empty string.
79-
mod_timestamp: '{{ .CommitTimestamp }}'
80-
goos:
8131
- windows
8232
goarch:
8333
- amd64
8434
- arm64
8535
ldflags:
86-
- -buildmode=exe
8736
- -s {{.Env.VERSION_LDFLAGS}}
8837

8938
checksum:

0 commit comments

Comments
 (0)