Skip to content

Commit

Permalink
fix: ignore non-arm64/386 builds when building Scoop manifest (#2172)
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Apr 18, 2021
1 parent 77101be commit e4e242f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
13 changes: 11 additions & 2 deletions internal/pipe/scoop/scoop.go
Expand Up @@ -193,9 +193,18 @@ func dataFor(ctx *context.Context, cl client.Client, artifacts []*artifact.Artif
}

for _, artifact := range artifacts {
var arch = "64bit"
if artifact.Goarch == "386" {
if artifact.Goos != "windows" {
continue
}

var arch string
switch {
case artifact.Goarch == "386":
arch = "32bit"
case artifact.Goarch == "amd64":
arch = "64bit"
default:
continue
}

url, err := tmpl.New(ctx).
Expand Down
17 changes: 17 additions & 0 deletions internal/pipe/scoop/scoop_test.go
Expand Up @@ -941,6 +941,23 @@ func Test_buildManifest(t *testing.T) {
},
},
},
{
Name: "foo_1.0.1_windows_arm.tar.gz",
Goos: "windows",
Goarch: "arm",
Path: file,
Extra: map[string]interface{}{
"ArtifactUploadHash": "820ead5d9d2266c728dce6d4d55b6460",
"Builds": []*artifact.Artifact{
{
Name: "foo.exe",
},
{
Name: "bar.exe",
},
},
},
},
{
Name: "foo_1.0.1_windows_386.tar.gz",
Goos: "windows",
Expand Down

0 comments on commit e4e242f

Please sign in to comment.