1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-04-11 11:42:15 +02:00

feat(scoop): support arm64 (#4193)

adds arm64 support to scoops.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2023-07-17 21:26:18 -03:00 committed by GitHub
parent dbcebd00ae
commit 58a6ba4e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 50 additions and 1 deletions

View File

@ -40,7 +40,7 @@ func (e ErrIncorrectArchiveCount) Error() string {
_, _ = b.WriteString(fmt.Sprintf("but found %d archives ", len(e.archives)))
}
_, _ = b.WriteString(fmt.Sprintf("matching the given filters: goos=windows goarch=[386 amd64] goamd64=%s ids=%s", e.goamd64, e.ids))
_, _ = b.WriteString(fmt.Sprintf("matching the given filters: goos=windows goarch=[386 amd64 arm64] goamd64=%s ids=%s", e.goamd64, e.ids))
if len(e.archives) > 0 {
names := make([]string, 0, len(e.archives))
@ -129,6 +129,7 @@ func doRun(ctx *context.Context, scoop config.Scoop, cl client.ReleaserURLTempla
artifact.ByGoarch("amd64"),
artifact.ByGoamd64(scoop.Goamd64),
),
artifact.ByGoarch("arm64"),
artifact.ByGoarch("386"),
),
}
@ -342,6 +343,8 @@ func dataFor(ctx *context.Context, scoop config.Scoop, cl client.ReleaserURLTemp
arch = "32bit"
case "amd64":
arch = "64bit"
case "arm64":
arch = "arm64"
default:
continue
}

View File

@ -132,6 +132,7 @@ func Test_doRun(t *testing.T) {
},
[]artifact.Artifact{
{Name: "foo_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64", Goamd64: "v1", Path: file},
{Name: "foo_1.0.1_windows_arm64.tar.gz", Goos: "windows", Goarch: "arm64", Path: file},
{Name: "foos_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64", Goamd64: "v1", Path: file},
},
func(tb testing.TB, err error) {
@ -140,6 +141,7 @@ func Test_doRun(t *testing.T) {
goamd64: "v1",
archives: []*artifact.Artifact{
{Name: "foo_1.0.1_windows_amd64.tar.gz"},
{Name: "foo_1.0.1_windows_arm64.tar.gz"},
{Name: "foos_1.0.1_windows_amd64.tar.gz"},
},
}.Error())
@ -939,6 +941,18 @@ func Test_buildManifest(t *testing.T) {
},
},
},
{
Name: "foo_1.0.1_windows_arm64.tar.gz",
Goos: "windows",
Goarch: "arm64",
Path: file,
Extra: map[string]interface{}{
artifact.ExtraBinaries: []string{
"foo.exe",
"bar.exe",
},
},
},
{
Name: "foo_1.0.1_windows_386.tar.gz",
Goos: "windows",

View File

@ -16,6 +16,14 @@
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
},
"arm64": {
"url": "https://github.com/test/test/releases/download/v1.0.1/foo_1.0.1_windows_arm64.tar.gz",
"bin": [
"foo.exe",
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
}
},
"homepage": "https://github.com/goreleaser",

View File

@ -16,6 +16,14 @@
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
},
"arm64": {
"url": "http://gitlab.mycompany.com/foo/bar/-/releases/v1.0.1/downloads/foo_1.0.1_windows_arm64.tar.gz",
"bin": [
"foo.exe",
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
}
},
"homepage": "https://gitlab.com/goreleaser",

View File

@ -16,6 +16,14 @@
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
},
"arm64": {
"url": "https://github.com/test/test/releases/download/v1.0.1/foo_1.0.1_windows_arm64.tar.gz",
"bin": [
"foo.exe",
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
}
},
"homepage": "https://github.com/goreleaser",

View File

@ -16,6 +16,14 @@
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
},
"arm64": {
"url": "http://github.mycompany.com/foo/bar/v1.0.1/foo_1.0.1_windows_arm64.tar.gz",
"bin": [
"foo.exe",
"bar.exe"
],
"hash": "5e2bf57d3f40c4b6df69daf1936cb766f832374b4fc0259a7cbff06e2f70f269"
}
},
"homepage": "https://github.com/goreleaser",