1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-06-23 00:40:06 +02:00

fix: prevent folder collisions in builds and universal binaries (#3063)

- on universal binaries, use the build id instead of the binary name to
  create the folder in the dist folder
- on builds, default the id the to the binary name instead of project
  name. The binary name already defaults to the project id if empty, so
  this should only prevent having to specify the id + binary name in
  some cases.

closes #3061

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2022-04-25 22:07:14 -03:00
committed by GitHub
parent 30630bfc7f
commit 5aeb8ace61
5 changed files with 13 additions and 8 deletions

View File

@ -353,7 +353,7 @@ func TestRun(t *testing.T) {
func checkUniversalBinary(tb testing.TB, unibin *artifact.Artifact) {
tb.Helper()
require.True(tb, strings.HasSuffix(unibin.Path, "foo_darwin_all/foo"))
require.True(tb, strings.HasSuffix(unibin.Path, unibin.ID()+"_darwin_all/foo"))
f, err := macho.OpenFat(unibin.Path)
require.NoError(tb, err)
require.Len(tb, f.Arches, 2)